19 | Swapping to the Development environment displays detailed information about the error that occurred.
20 |
21 |
22 | The Development environment shouldn't be enabled for deployed applications.
23 | It can result in displaying sensitive information from exceptions to end users.
24 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
25 | and restarting the app.
26 |
27 |
--------------------------------------------------------------------------------
/VazorPages1/Pages/Error.cshtml.vb:
--------------------------------------------------------------------------------
1 | imports System
2 | imports System.Collections.Generic
3 | imports System.Diagnostics
4 | imports System.Linq
5 | imports System.Threading.Tasks
6 | imports Microsoft.AspNetCore.Mvc
7 | imports Microsoft.AspNetCore.Mvc.RazorPages
8 |
9 |
10 |
11 | Public Class ErrorModel : Inherits PageModel
12 |
13 | Public Property RequestId As String
14 |
15 | Public Property ShowRequestId As Boolean = Not String.IsNullOrEmpty(RequestId)
16 |
17 | Public Sub OnGet()
18 | RequestId = If(Activity.Current?.Id, HttpContext.TraceIdentifier)
19 | End Sub
20 | End Class
21 |
--------------------------------------------------------------------------------
/VazorPages1/Pages/Index.cshtml:
--------------------------------------------------------------------------------
1 | @page
2 | @model IndexModel
3 |
4 |
5 | @Html.Partial(Model.ViewName + ".cshtml")
6 |
--------------------------------------------------------------------------------
/VazorPages1/Pages/Index.cshtml.vb:
--------------------------------------------------------------------------------
1 | Imports Microsoft.AspNetCore.Mvc.RazorPages
2 | Imports Vazor
3 |
4 | Public Class IndexModel : Inherits PageModel
5 |
6 | ' This property is used in the Index.cshtml,
7 | ' to inject our vbxml code in the page as a pratial view
8 |
9 | Const Title = "Index"
10 |
11 | Public ReadOnly Property ViewName As String
12 | Get
13 | ViewData("Title") = Title
14 | Dim html = GetVbXml(Students, ViewData).Parsezml()
15 | Return VazorPage.CreateNew("Index", "Pages", Title, html)
16 | End Get
17 | End Property
18 |
19 | Public ReadOnly Property Students As List(Of Student)
20 | Get
21 | Return SomeStudents.Students
22 | End Get
23 | End Property
24 |
25 | Public Sub OnGet()
26 |
27 | End Sub
28 |
29 | End Class
30 |
--------------------------------------------------------------------------------
/VazorPages1/Pages/Privacy.cshtml:
--------------------------------------------------------------------------------
1 | @page
2 | @model PrivacyModel
3 | @{
4 | ViewData["Title"] = "Privacy Policy";
5 | }
6 |
@ViewData["Title"]
7 |
8 |
Use this page to detail your site's privacy policy.
9 |
--------------------------------------------------------------------------------
/VazorPages1/Pages/Privacy.cshtml.vb:
--------------------------------------------------------------------------------
1 | Imports System
2 | Imports System.Collections.Generic
3 | Imports System.Linq
4 | Imports System.Threading.Tasks
5 | Imports Microsoft.AspNetCore.Mvc
6 | Imports Microsoft.AspNetCore.Mvc.RazorPages
7 |
8 | Public Class PrivacyModel : Inherits PageModel
9 | Public Sub OnGet()
10 |
11 | End Sub
12 | End Class
13 |
--------------------------------------------------------------------------------
/VazorPages1/Pages/Shared/_CookieConsentPartial.cshtml:
--------------------------------------------------------------------------------
1 | @using Microsoft.AspNetCore.Http.Features
2 |
3 | @{
4 | var consentFeature = Context.Features.Get();
5 | var showBanner = !consentFeature?.CanTrack ?? false;
6 | var cookieString = consentFeature?.CreateConsentCookie();
7 | }
8 |
9 | @if (showBanner)
10 | {
11 |
12 | Use this space to summarize your privacy and cookie use policy. Learn More.
13 |
16 |
17 |
25 | }
26 |
--------------------------------------------------------------------------------
/VazorPages1/Pages/Shared/_ValidationScriptsPartial.cshtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
12 |
18 |
19 |
--------------------------------------------------------------------------------
/VazorPages1/Pages/_ViewImports.cshtml:
--------------------------------------------------------------------------------
1 | @using VazorPages1
2 | @namespace VazorPages1.Pages
3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
4 |
--------------------------------------------------------------------------------
/VazorPages1/Pages/_ViewStart.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | Layout = "_Layout";
3 | }
4 |
--------------------------------------------------------------------------------
/VazorPages1/Program.vb:
--------------------------------------------------------------------------------
1 | Imports Microsoft.AspNetCore
2 | Imports Microsoft.AspNetCore.Hosting
3 | Imports Microsoft.Extensions.Hosting
4 |
5 | Module Program
6 | Sub Main(args As String())
7 | CreateHostBuilder(args).Build().Run()
8 | End Sub
9 |
10 | Public Function CreateHostBuilder(args() As String) As IWebHostBuilder
11 | Return WebHost.CreateDefaultBuilder(args).UseStartup(Of Startup)()
12 | End Function
13 | End Module
14 |
--------------------------------------------------------------------------------
/VazorPages1/VazorPages1.vbproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp2.2
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/VazorPages1/VazorPages1.vbproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | IIS Express
5 |
6 |
--------------------------------------------------------------------------------
/VazorPages1/VazorPages1.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VBAndCs/Vazor-DotNetCore2/feaaac81dc5a41f5992cfe0ef3d619ebe014cbaa/VazorPages1/VazorPages1.zip
--------------------------------------------------------------------------------
/VazorPages1/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Debug",
5 | "System": "Information",
6 | "Microsoft": "Information"
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/VazorPages1/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Warning",
5 | "Microsoft.Hosting.Lifetime": "Information"
6 | }
7 | },
8 | "AllowedHosts": "*"
9 | }
10 |
--------------------------------------------------------------------------------
/VazorPages1/bin/Debug/netcoreapp2.2/VazorPages1.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VBAndCs/Vazor-DotNetCore2/feaaac81dc5a41f5992cfe0ef3d619ebe014cbaa/VazorPages1/bin/Debug/netcoreapp2.2/VazorPages1.dll
--------------------------------------------------------------------------------
/VazorPages1/bin/Debug/netcoreapp2.2/VazorPages1.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VBAndCs/Vazor-DotNetCore2/feaaac81dc5a41f5992cfe0ef3d619ebe014cbaa/VazorPages1/bin/Debug/netcoreapp2.2/VazorPages1.pdb
--------------------------------------------------------------------------------
/VazorPages1/bin/Debug/netcoreapp2.2/VazorPages1.runtimeconfig.dev.json:
--------------------------------------------------------------------------------
1 | {
2 | "runtimeOptions": {
3 | "additionalProbingPaths": [
4 | "C:\\Users\\MHG\\.dotnet\\store\\|arch|\\|tfm|",
5 | "C:\\Users\\MHG\\.nuget\\packages",
6 | "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder"
7 | ]
8 | }
9 | }
--------------------------------------------------------------------------------
/VazorPages1/bin/Debug/netcoreapp2.2/VazorPages1.runtimeconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "runtimeOptions": {
3 | "tfm": "netcoreapp2.2",
4 | "framework": {
5 | "name": "Microsoft.AspNetCore.App",
6 | "version": "2.2.0"
7 | },
8 | "configProperties": {
9 | "System.GC.Server": true
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/VazorPages1/obj/Debug/netcoreapp2.1/VazorPages1.AssemblyInfo.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' This code was generated by a tool.
4 | ' Runtime Version:4.0.30319.42000
5 | '
6 | ' Changes to this file may cause incorrect behavior and will be lost if
7 | ' the code is regenerated.
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict Off
12 | Option Explicit On
13 |
14 | Imports System
15 | Imports System.Reflection
16 |
23 |
24 | 'Generated by the MSBuild WriteCodeFragment class.
25 |
--------------------------------------------------------------------------------
/VazorPages1/obj/Debug/netcoreapp2.1/VazorPages1.AssemblyInfoInputs.cache:
--------------------------------------------------------------------------------
1 | 500804f989f4a17be1a9d33378eef23376cde029
2 |
--------------------------------------------------------------------------------
/VazorPages1/obj/Debug/netcoreapp2.1/VazorPages1.assets.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VBAndCs/Vazor-DotNetCore2/feaaac81dc5a41f5992cfe0ef3d619ebe014cbaa/VazorPages1/obj/Debug/netcoreapp2.1/VazorPages1.assets.cache
--------------------------------------------------------------------------------
/VazorPages1/obj/Debug/netcoreapp2.1/VazorPages1.vbproj.CoreCompileInputs.cache:
--------------------------------------------------------------------------------
1 | 68357ed247b1e73776822beba378e967bbc11276
2 |
--------------------------------------------------------------------------------
/VazorPages1/obj/Debug/netcoreapp2.1/VazorPages1.vbproj.FileListAbsolute.txt:
--------------------------------------------------------------------------------
1 | F:\_VS.NET\Vazor\VazorPages1\obj\Debug\netcoreapp2.1\VazorPages1.vbprojAssemblyReference.cache
2 | F:\_VS.NET\Vazor\VazorPages1\obj\Debug\netcoreapp2.1\VazorPages1.vbproj.CoreCompileInputs.cache
3 | F:\_VS.NET\Vazor\VazorPages1\obj\Debug\netcoreapp2.1\VazorPages1.AssemblyInfoInputs.cache
4 | F:\_VS.NET\Vazor\VazorPages1\obj\Debug\netcoreapp2.1\VazorPages1.AssemblyInfo.vb
5 |
--------------------------------------------------------------------------------
/VazorPages1/obj/Debug/netcoreapp2.1/VazorPages1.vbprojAssemblyReference.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VBAndCs/Vazor-DotNetCore2/feaaac81dc5a41f5992cfe0ef3d619ebe014cbaa/VazorPages1/obj/Debug/netcoreapp2.1/VazorPages1.vbprojAssemblyReference.cache
--------------------------------------------------------------------------------
/VazorPages1/obj/Debug/netcoreapp2.2/VazorPages1.AssemblyInfo.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' This code was generated by a tool.
4 | ' Runtime Version:4.0.30319.42000
5 | '
6 | ' Changes to this file may cause incorrect behavior and will be lost if
7 | ' the code is regenerated.
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict Off
12 | Option Explicit On
13 |
14 | Imports System
15 | Imports System.Reflection
16 |
23 |
24 | 'Generated by the MSBuild WriteCodeFragment class.
25 |
--------------------------------------------------------------------------------
/VazorPages1/obj/Debug/netcoreapp2.2/VazorPages1.AssemblyInfoInputs.cache:
--------------------------------------------------------------------------------
1 | 500804f989f4a17be1a9d33378eef23376cde029
2 |
--------------------------------------------------------------------------------
/VazorPages1/obj/Debug/netcoreapp2.2/VazorPages1.assets.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VBAndCs/Vazor-DotNetCore2/feaaac81dc5a41f5992cfe0ef3d619ebe014cbaa/VazorPages1/obj/Debug/netcoreapp2.2/VazorPages1.assets.cache
--------------------------------------------------------------------------------
/VazorPages1/obj/Debug/netcoreapp2.2/VazorPages1.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VBAndCs/Vazor-DotNetCore2/feaaac81dc5a41f5992cfe0ef3d619ebe014cbaa/VazorPages1/obj/Debug/netcoreapp2.2/VazorPages1.dll
--------------------------------------------------------------------------------
/VazorPages1/obj/Debug/netcoreapp2.2/VazorPages1.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VBAndCs/Vazor-DotNetCore2/feaaac81dc5a41f5992cfe0ef3d619ebe014cbaa/VazorPages1/obj/Debug/netcoreapp2.2/VazorPages1.pdb
--------------------------------------------------------------------------------
/VazorPages1/obj/Debug/netcoreapp2.2/VazorPages1.vbproj.CoreCompileInputs.cache:
--------------------------------------------------------------------------------
1 | df13cb3d1b9bbc14371a1f12081904ee25315381
2 |
--------------------------------------------------------------------------------
/VazorPages1/obj/Debug/netcoreapp2.2/VazorPages1.vbproj.FileListAbsolute.txt:
--------------------------------------------------------------------------------
1 | F:\_VS.NET\Vazor\VazorPages1\obj\Debug\netcoreapp2.2\VazorPages1.vbprojAssemblyReference.cache
2 | F:\_VS.NET\Vazor\VazorPages1\obj\Debug\netcoreapp2.2\VazorPages1.vbproj.CoreCompileInputs.cache
3 | F:\_VS.NET\Vazor\VazorPages1\obj\Debug\netcoreapp2.2\VazorPages1.AssemblyInfoInputs.cache
4 | F:\_VS.NET\Vazor\VazorPages1\obj\Debug\netcoreapp2.2\VazorPages1.AssemblyInfo.vb
5 | F:\_VS.NET\Vazor\VazorPages1\bin\Debug\netcoreapp2.2\VazorPages1.deps.json
6 | F:\_VS.NET\Vazor\VazorPages1\bin\Debug\netcoreapp2.2\VazorPages1.runtimeconfig.json
7 | F:\_VS.NET\Vazor\VazorPages1\bin\Debug\netcoreapp2.2\VazorPages1.runtimeconfig.dev.json
8 | F:\_VS.NET\Vazor\VazorPages1\bin\Debug\netcoreapp2.2\VazorPages1.dll
9 | F:\_VS.NET\Vazor\VazorPages1\bin\Debug\netcoreapp2.2\VazorPages1.pdb
10 | F:\_VS.NET\Vazor\VazorPages1\obj\Debug\netcoreapp2.2\VazorPages1.dll
11 | F:\_VS.NET\Vazor\VazorPages1\obj\Debug\netcoreapp2.2\VazorPages1.pdb
12 |
--------------------------------------------------------------------------------
/VazorPages1/obj/Debug/netcoreapp2.2/VazorPages1.vbprojAssemblyReference.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VBAndCs/Vazor-DotNetCore2/feaaac81dc5a41f5992cfe0ef3d619ebe014cbaa/VazorPages1/obj/Debug/netcoreapp2.2/VazorPages1.vbprojAssemblyReference.cache
--------------------------------------------------------------------------------
/VazorPages1/obj/VazorPages1.vbproj.nuget.cache:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | "dgSpecHash": "YHP/sFDpMnUvCWCpt95VzEnnyipznKnXvNdphuxGCycFZ4J2plq3yyQULoPvr5SjNsBFavRwhoBwnkDCrfkq9g==",
4 | "success": true
5 | }
--------------------------------------------------------------------------------
/VazorPages1/wwwroot/css/site.css:
--------------------------------------------------------------------------------
1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
2 | for details on configuring this project to bundle and minify static web assets. */
3 |
4 | a.navbar-brand {
5 | white-space: normal;
6 | text-align: center;
7 | word-break: break-all;
8 | }
9 |
10 | /* Sticky footer styles
11 | -------------------------------------------------- */
12 | html {
13 | font-size: 14px;
14 | }
15 | @media (min-width: 768px) {
16 | html {
17 | font-size: 16px;
18 | }
19 | }
20 |
21 | .border-top {
22 | border-top: 1px solid #e5e5e5;
23 | }
24 | .border-bottom {
25 | border-bottom: 1px solid #e5e5e5;
26 | }
27 |
28 | .box-shadow {
29 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
30 | }
31 |
32 | button.accept-policy {
33 | font-size: 1rem;
34 | line-height: inherit;
35 | }
36 |
37 | /* Sticky footer styles
38 | -------------------------------------------------- */
39 | html {
40 | position: relative;
41 | min-height: 100%;
42 | }
43 |
44 | body {
45 | /* Margin bottom by footer height */
46 | margin-bottom: 60px;
47 | }
48 | .footer {
49 | position: absolute;
50 | bottom: 0;
51 | width: 100%;
52 | white-space: nowrap;
53 | /* Set the fixed height of the footer here */
54 | height: 60px;
55 | line-height: 60px; /* Vertically center the text there */
56 | }
57 |
--------------------------------------------------------------------------------
/VazorPages1/wwwroot/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VBAndCs/Vazor-DotNetCore2/feaaac81dc5a41f5992cfe0ef3d619ebe014cbaa/VazorPages1/wwwroot/favicon.ico
--------------------------------------------------------------------------------
/VazorPages1/wwwroot/js/site.js:
--------------------------------------------------------------------------------
1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
2 | // for details on configuring this project to bundle and minify static web assets.
3 |
4 | // Write your Javascript code.
5 |
--------------------------------------------------------------------------------
/VazorPages1/wwwroot/lib/bootstrap/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2011-2018 Twitter, Inc.
4 | Copyright (c) 2011-2018 The Bootstrap Authors
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 |
--------------------------------------------------------------------------------
/VazorPages1/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) .NET Foundation. All rights reserved.
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4 | these files except in compliance with the License. You may obtain a copy of the
5 | License at
6 |
7 | http://www.apache.org/licenses/LICENSE-2.0
8 |
9 | Unless required by applicable law or agreed to in writing, software distributed
10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the
12 | specific language governing permissions and limitations under the License.
13 |
--------------------------------------------------------------------------------
/VazorPages1/wwwroot/lib/jquery-validation/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 | =====================
3 |
4 | Copyright Jörn Zaefferer
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 |
--------------------------------------------------------------------------------
/WebApp1/Controllers/HomeController.vb:
--------------------------------------------------------------------------------
1 | Imports System
2 | Imports System.Collections.Generic
3 | Imports System.Diagnostics
4 | Imports System.Linq
5 | Imports System.Threading.Tasks
6 | Imports WebApp1.Models
7 | Imports Microsoft.AspNetCore.Mvc
8 |
9 | Namespace Controllers
10 | Public Class HomeController : Inherits Controller
11 |
12 | Public Function Index() As IActionResult
13 | Return View(IndexView.CreateNew(Students, ViewData), Students)
14 | End Function
15 |
16 | Public Function Privacy() As IActionResult
17 | Return View()
18 | End Function
19 |
20 |
21 | Public Function [Error]() As IActionResult
22 | Return View(New ErrorViewModel With {.RequestId = If(Activity.Current?.Id, HttpContext.TraceIdentifier)})
23 | End Function
24 | End Class
25 |
26 | End Namespace
--------------------------------------------------------------------------------
/WebApp1/Data/SomeStudents.vb:
--------------------------------------------------------------------------------
1 | Module SomeStudents
2 | Public Students As New List(Of Student) From {
3 | New Student With {.Id = 1, .Name = "Adam", .Age = 20, .Grade = 69},
4 | New Student With {.Id = 2, .Name = "Mark", .Age = 21, .Grade = 80},
5 | New Student With {.Id = 3, .Name = "Tom", .Age = 18, .Grade = 51}
6 | }
7 | End Module
8 |
--------------------------------------------------------------------------------
/WebApp1/Models/ErrorViewModel.vb:
--------------------------------------------------------------------------------
1 | Namespace Models
2 | Public Class ErrorViewModel
3 | Public Property RequestId As String
4 |
5 | Public ReadOnly Property ShowRequestId() As Boolean
6 | Get
7 | Return Not String.IsNullOrEmpty(RequestId)
8 | End Get
9 | End Property
10 | End Class
11 | End Namespace
--------------------------------------------------------------------------------
/WebApp1/Models/Student.vb:
--------------------------------------------------------------------------------
1 | Public Class Student
2 | Public Id As Integer
3 | Public Name As String
4 | Public Age As Integer
5 | Public Grade As Integer
6 | End Class
7 |
--------------------------------------------------------------------------------
/WebApp1/My Project/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:57080",
7 | "sslPort": 44385
8 | }
9 | },
10 | "profiles": {
11 | "IIS Express": {
12 | "commandName": "IISExpress",
13 | "launchBrowser": true,
14 | "environmentVariables": {
15 | "ASPNETCORE_ENVIRONMENT": "Development"
16 | }
17 | },
18 | "WebApp1": {
19 | "commandName": "Project",
20 | "launchBrowser": true,
21 | "applicationUrl": "https://localhost:5001;http://localhost:5000",
22 | "environmentVariables": {
23 | "ASPNETCORE_ENVIRONMENT": "Development"
24 | }
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/WebApp1/Program.vb:
--------------------------------------------------------------------------------
1 | Imports System
2 | Imports System.Collections.Generic
3 | Imports System.IO
4 | Imports System.Linq
5 | Imports System.Threading.Tasks
6 | Imports Microsoft.AspNetCore
7 | Imports Microsoft.AspNetCore.Hosting
8 | Imports Microsoft.Extensions.Configuration
9 | Imports Microsoft.Extensions.Hosting
10 | Imports Microsoft.Extensions.Logging
11 |
12 | Module Program
13 | Sub Main(args As String())
14 | CreateHostBuilder(args).Build().Run()
15 | End Sub
16 |
17 | Public Function CreateHostBuilder(args() As String) As IWebHostBuilder
18 | Return WebHost.CreateDefaultBuilder(args).UseStartup(Of Startup)()
19 | End Function
20 | End Module
21 |
--------------------------------------------------------------------------------
/WebApp1/Views/Home/Index.vazor.vb:
--------------------------------------------------------------------------------
1 | Imports Microsoft.AspNetCore.Mvc.ViewFeatures
2 | Imports Vazor
3 |
4 | ' To add anew vzor view, right-click the folder in solution explorer
5 | ' click Add/New item, and chosse the "VazorView" item from the window
6 | ' This will add both the vazor.vb and vbxml.vb files to the folder.
7 |
8 | Public Class IndexView
9 | Inherits VazorView
10 |
11 | Public ReadOnly Property Students As List(Of Student)
12 |
13 | Public ReadOnly Property ViewData() As ViewDataDictionary
14 |
15 | ' Supply your actual view name, path, and title to the MyBas.New
16 | ' By defualt, UTF encoding is used to render the view.
17 | ' You can send another encoding to the forth param of the MyBase.New.
18 |
19 | Public Sub New(students As List(Of Student), viewData As ViewDataDictionary)
20 | MyBase.New("Index", "Views\Home", "Hello")
21 | Me.Students = students
22 | Me.ViewData = viewData
23 | viewData("Title") = Title
24 | End Sub
25 |
26 | ' This function is called in the "Index" action method in the HomeController:
27 | ' View(IndexView.CreateNew(Students, ViewData))
28 |
29 | Public Shared Function CreateNew(Students As List(Of Student), viewData As ViewDataDictionary) As String
30 | Return VazorViewMapper.Add(New IndexView(Students, viewData))
31 | End Function
32 |
33 | End Class
34 |
--------------------------------------------------------------------------------
/WebApp1/Views/Home/Privacy.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewData["Title"] = "Privacy Policy";
3 | }
4 |
@ViewData["Title"]
5 |
6 |
Use this page to detail your site's privacy policy.
18 | Swapping to Development environment will display more detailed information about the error that occurred.
19 |
20 |
21 | The Development environment shouldn't be enabled for deployed applications.
22 | It can result in displaying sensitive information from exceptions to end users.
23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
24 | and restarting the app.
25 |
--------------------------------------------------------------------------------
/eShopOnWeb.vazor/Web.VB/Pages/Error.cshtml.vb:
--------------------------------------------------------------------------------
1 | Imports Microsoft.AspNetCore.Mvc
2 | Imports Microsoft.AspNetCore.Mvc.RazorPages
3 | Imports Vazor
4 | Imports ZML
5 |
6 | Namespace Pages
7 |
8 | Public Class ErrorModel : Inherits PageModel
9 |
10 | Const Title = "Error"
11 |
12 | Public ReadOnly Property ViewName As String
13 | Get
14 | ViewData("Title") = Title
15 | Dim html = Me.GetVbXml().ParseZML()
16 | Return VazorPage.CreateNew("Error", "Pages", Title, html)
17 | End Get
18 | End Property
19 |
20 |
21 | Public Property RequestId As String
22 |
23 | Public ReadOnly Property ShowRequestId As Boolean
24 | Get
25 | Return Not String.IsNullOrEmpty(RequestId)
26 | End Get
27 | End Property
28 |
29 | Public Sub OnGet()
30 | RequestId = If(Activity.Current?.Id, HttpContext.TraceIdentifier)
31 | End Sub
32 |
33 | End Class
34 | End Namespace
--------------------------------------------------------------------------------
/eShopOnWeb.vazor/Web.VB/Pages/Error.vbxml.vb:
--------------------------------------------------------------------------------
1 | Namespace Pages
2 |
3 | Partial Public Class ErrorModel
4 | Private Function GetVbXml() As XElement
5 |
6 | Return _
7 |
8 |
9 |
10 |
Error
11 |
An error occurred while processing your request.
12 |
13 |
14 |
15 | Request ID:@Model.RequestId
16 |
17 |
18 |
19 |
Development Mode
20 |
Swapping to the Development environment displays detailed information about the error that occurred.
21 |
22 | The Development environment shouldn't be enabled for deployed applications.
23 | It can result in displaying sensitive information from exceptions to end users.
24 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
25 | and restarting the app.
26 |
27 |
28 | End Function
29 | End Class
30 | End Namespace
31 |
--------------------------------------------------------------------------------
/eShopOnWeb.vazor/Web.VB/Pages/Index.cshtml:
--------------------------------------------------------------------------------
1 | @page
2 | @model IndexModel
3 |
4 |
25 |
26 |
27 |
28 |
29 | End Function
30 | End Class
31 |
32 | End Namespace
--------------------------------------------------------------------------------
/eShopOnWeb.vazor/Web.VB/Pages/_ViewImports.vbxml.vb:
--------------------------------------------------------------------------------
1 |
2 | Imports Vazor
3 |
4 | Namespace Pages
5 |
6 | Public Class ViewImports
7 | Inherits VazorSharedView
8 |
9 | Public Sub New()
10 | MyBase.New("_ViewImports", "Pages", "ViewImports")
11 | End Sub
12 |
13 | Public Overrides Function GetVbXml() As XElement
14 | Return _
15 | _
16 |
17 | Microsoft.eShopWeb.Web
18 |
19 | Microsoft.eShopWeb.Web.ViewModels.Account
20 |
21 |
22 |
23 |
24 | Microsoft.eShopWeb.Web.Pages
25 |
26 |
27 |
28 | End Function
29 | End Class
30 | End Namespace
--------------------------------------------------------------------------------
/eShopOnWeb.vazor/Web.VB/Pages/_ViewStart.vbxml.vb:
--------------------------------------------------------------------------------
1 | Imports Vazor
2 |
3 | Namespace Pages
4 | Partial Public Class ViewStart
5 | Inherits VazorSharedView
6 |
7 | Public Sub New()
8 | MyBase.New("_ViewStart", "Pages", "ViewStart")
9 | End Sub
10 |
11 | Public Overrides Function GetVbXml() As XElement
12 | Return _
13 | _
14 |
15 |
16 |
17 |
18 | End Function
19 |
20 |
21 | End Class
22 | End Namespace
--------------------------------------------------------------------------------
/eShopOnWeb.vazor/Web.VB/SlugifyParameterTransformer.vb:
--------------------------------------------------------------------------------
1 | Imports Microsoft.AspNetCore.Routing
2 | Imports System.Text.RegularExpressions
3 |
4 |
5 | Public Class SlugifyParameterTransformer
6 | Implements IOutboundParameterTransformer
7 |
8 | Public Function TransformOutbound(ByVal value As Object) As String _
9 | Implements IOutboundParameterTransformer.TransformOutbound
10 |
11 | If value Is Nothing Then
12 | Return Nothing
13 | End If
14 |
15 | Return Regex.Replace(value.ToString(), "([a-z])([A-Z])", "$1-$2").ToLower()
16 | End Function
17 | End Class
18 |
--------------------------------------------------------------------------------
/eShopOnWeb.vazor/Web.VB/ViewModels/Account/LoginViewModel.vb:
--------------------------------------------------------------------------------
1 | Imports System.ComponentModel.DataAnnotations
2 |
3 | Namespace ViewModels.Account
4 | Public Class LoginViewModel
5 |
6 |
7 | Public Property Email As String
8 |
9 |
10 | Public Property Password As String
11 |
12 | Public Property RememberMe As Boolean
13 | End Class
14 | End Namespace
15 |
--------------------------------------------------------------------------------
/eShopOnWeb.vazor/Web.VB/ViewModels/Account/LoginWith2faViewModel.vb:
--------------------------------------------------------------------------------
1 | Imports System.ComponentModel.DataAnnotations
2 |
3 | Namespace ViewModels.Account
4 | Public Class LoginWith2faViewModel
5 |
6 |
7 |
8 |
9 | Public Property TwoFactorCode As String
10 |
11 | Public Property RememberMachine As Boolean
12 | Public Property RememberMe As Boolean
13 | End Class
14 | End Namespace
15 |
--------------------------------------------------------------------------------
/eShopOnWeb.vazor/Web.VB/ViewModels/Account/RegisterViewModel.vb:
--------------------------------------------------------------------------------
1 | Imports System.ComponentModel.DataAnnotations
2 |
3 | Namespace ViewModels.Account
4 | Public Class RegisterViewModel
5 |
6 |
7 |
8 | Public Property Email As String
9 |
10 |
11 |
12 |
13 | Public Property Password As String
14 |
15 |
16 |
17 | Public Property ConfirmPassword As String
18 | End Class
19 | End Namespace
20 |
--------------------------------------------------------------------------------
/eShopOnWeb.vazor/Web.VB/ViewModels/Account/ResetPasswordViewModel.vb:
--------------------------------------------------------------------------------
1 | Imports System.ComponentModel.DataAnnotations
2 |
3 | Namespace ViewModels.Account
4 | Public Class ResetPasswordViewModel
5 |
6 |
7 | Public Property Email As String
8 |
9 |
10 |
11 | Public Property Password As String
12 |
13 |
14 |
15 | Public Property ConfirmPassword As String
16 | Public Property Code As String
17 | End Class
18 | End Namespace
19 |
--------------------------------------------------------------------------------
/eShopOnWeb.vazor/Web.VB/ViewModels/BasketComponentViewModel.vb:
--------------------------------------------------------------------------------
1 | Namespace ViewModels
2 | Public Class BasketComponentViewModel
3 | Public Property ItemsCount As Integer
4 | End Class
5 | End Namespace
6 |
--------------------------------------------------------------------------------
/eShopOnWeb.vazor/Web.VB/ViewModels/CatalogIndexViewModel.vb:
--------------------------------------------------------------------------------
1 | Imports Microsoft.AspNetCore.Mvc.Rendering
2 |
3 | Namespace ViewModels
4 | Public Class CatalogIndexViewModel
5 | Public Property CatalogItems As IEnumerable(Of CatalogItemViewModel)
6 | Public Property Brands As IEnumerable(Of SelectListItem)
7 | Public Property Types As IEnumerable(Of SelectListItem)
8 | Public Property BrandFilterApplied As Integer?
9 | Public Property TypesFilterApplied As Integer?
10 | Public Property PaginationInfo As PaginationInfoViewModel
11 | End Class
12 | End Namespace
13 |
--------------------------------------------------------------------------------
/eShopOnWeb.vazor/Web.VB/ViewModels/CatalogItemViewModel.vb:
--------------------------------------------------------------------------------
1 | Namespace ViewModels
2 | Public Class CatalogItemViewModel
3 | Public Property Id As Integer
4 | Public Property Name As String
5 | Public Property PictureUri As String
6 | Public Property Price As Decimal
7 | End Class
8 | End Namespace
9 |
--------------------------------------------------------------------------------
/eShopOnWeb.vazor/Web.VB/ViewModels/Manage/ChangePasswordViewModel.vb:
--------------------------------------------------------------------------------
1 | Imports System.ComponentModel.DataAnnotations
2 |
3 | Namespace ViewModels.Manage
4 | Public Class ChangePasswordViewModel
5 |
6 |
7 |
8 | Public Property OldPassword As String
9 |
10 |
11 |
12 |
13 | Public Property NewPassword As String
14 |
15 |
16 |
17 | Public Property ConfirmPassword As String
18 | Public Property StatusMessage As String
19 | End Class
20 | End Namespace
21 |
--------------------------------------------------------------------------------
/eShopOnWeb.vazor/Web.VB/ViewModels/Manage/EnableAuthenticatorViewModel.vb:
--------------------------------------------------------------------------------
1 | Imports System.ComponentModel
2 | Imports System.ComponentModel.DataAnnotations
3 |
4 | Namespace ViewModels.Manage
5 | Public Class EnableAuthenticatorViewModel
6 |
7 |
8 |
9 |
10 | Public Property Code As String
11 | <[ReadOnly](True)>
12 | Public Property SharedKey As String
13 | Public Property AuthenticatorUri As String
14 | End Class
15 | End Namespace
16 |
--------------------------------------------------------------------------------
/eShopOnWeb.vazor/Web.VB/ViewModels/Manage/ExternalLoginsViewModel.vb:
--------------------------------------------------------------------------------
1 | Imports Microsoft.AspNetCore.Authentication
2 | Imports Microsoft.AspNetCore.Identity
3 | Imports System.Collections.Generic
4 |
5 | Namespace ViewModels.Manage
6 | Public Class ExternalLoginsViewModel
7 | Public Property CurrentLogins As IList(Of UserLoginInfo)
8 | Public Property OtherLogins As IList(Of AuthenticationScheme)
9 | Public Property ShowRemoveButton As Boolean
10 | Public Property StatusMessage As String
11 | End Class
12 | End Namespace
13 |
--------------------------------------------------------------------------------
/eShopOnWeb.vazor/Web.VB/ViewModels/Manage/GenerateRecoveryCodesViewModel.vb:
--------------------------------------------------------------------------------
1 | Namespace ViewModels.Manage
2 | Public Class GenerateRecoveryCodesViewModel
3 | Public Property RecoveryCodes As String()
4 | End Class
5 | End Namespace
6 |
--------------------------------------------------------------------------------
/eShopOnWeb.vazor/Web.VB/ViewModels/Manage/IndexViewModel.vb:
--------------------------------------------------------------------------------
1 | Imports System.ComponentModel.DataAnnotations
2 |
3 | Namespace ViewModels.Manage
4 | Public Class IndexViewModel
5 | Public Property Username As String
6 | Public Property IsEmailConfirmed As Boolean
7 |
8 |
9 | Public Property Email As String
10 |
11 |
12 | Public Property PhoneNumber As String
13 | Public Property StatusMessage As String
14 | End Class
15 | End Namespace
16 |
--------------------------------------------------------------------------------
/eShopOnWeb.vazor/Web.VB/ViewModels/Manage/RemoveLoginViewModel.vb:
--------------------------------------------------------------------------------
1 | Namespace ViewModels.Manage
2 | Public Class RemoveLoginViewModel
3 | Public Property LoginProvider As String
4 | Public Property ProviderKey As String
5 | End Class
6 | End Namespace
7 |
--------------------------------------------------------------------------------
/eShopOnWeb.vazor/Web.VB/ViewModels/Manage/SetPasswordViewModel.vb:
--------------------------------------------------------------------------------
1 | Imports System.ComponentModel.DataAnnotations
2 |
3 | Namespace ViewModels.Manage
4 | Public Class SetPasswordViewModel
5 |
6 |
7 |
8 |
9 | Public Property NewPassword As String
10 |
11 |
12 |
13 | Public Property ConfirmPassword As String
14 | Public Property StatusMessage As String
15 | End Class
16 | End Namespace
17 |
--------------------------------------------------------------------------------
/eShopOnWeb.vazor/Web.VB/ViewModels/Manage/TwoFactorAuthenticationViewModel.vb:
--------------------------------------------------------------------------------
1 | Namespace ViewModels.Manage
2 | Public Class TwoFactorAuthenticationViewModel
3 | Public Property HasAuthenticator As Boolean
4 | Public Property RecoveryCodesLeft As Integer
5 | Public Property Is2faEnabled As Boolean
6 | End Class
7 | End Namespace
8 |
--------------------------------------------------------------------------------
/eShopOnWeb.vazor/Web.VB/ViewModels/OrderItemViewModel.vb:
--------------------------------------------------------------------------------
1 | Namespace ViewModels
2 | Public Class OrderItemViewModel
3 | Public Property ProductId As Integer
4 | Public Property ProductName As String
5 | Public Property UnitPrice As Decimal
6 | Public Property Discount As Decimal
7 | Public Property Units As Integer
8 | Public Property PictureUrl As String
9 | End Class
10 | End Namespace
11 |
--------------------------------------------------------------------------------
/eShopOnWeb.vazor/Web.VB/ViewModels/OrderViewModel.vb:
--------------------------------------------------------------------------------
1 | Imports Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate
2 | Imports System
3 | Imports System.Collections.Generic
4 |
5 | Namespace ViewModels
6 | Public Class OrderViewModel
7 | Public Property OrderNumber As Integer
8 | Public Property OrderDate As DateTimeOffset
9 | Public Property Total As Decimal
10 | Public Property Status As String
11 | Public Property ShippingAddress As Address
12 | Public Property OrderItems As List(Of OrderItemViewModel) = New List(Of OrderItemViewModel)()
13 | End Class
14 | End Namespace
15 |
--------------------------------------------------------------------------------
/eShopOnWeb.vazor/Web.VB/ViewModels/PaginationInfoViewModel.vb:
--------------------------------------------------------------------------------
1 | Namespace ViewModels
2 | Public Class PaginationInfoViewModel
3 | Public Property TotalItems As Integer
4 | Public Property ItemsPerPage As Integer
5 | Public Property ActualPage As Integer
6 | Public Property TotalPages As Integer
7 | Public Property Previous As String
8 | Public Property [Next] As String
9 | End Class
10 | End Namespace
11 |
--------------------------------------------------------------------------------
/eShopOnWeb.vazor/Web.VB/Views/Account/Lockout.vbxml.vb:
--------------------------------------------------------------------------------
1 | Imports Vazor
2 |
3 | Namespace Views.Account
4 | Partial Public Class LockoutView
5 | Inherits VazorSharedView
6 |
7 | Public Sub New()
8 | MyBase.New("Lockout", "Views\Account", "Lockout")
9 | End Sub
10 |
11 | Public Overrides Function GetVbXml() As XElement
12 | Return _
13 | _
14 |
15 | Locked out
16 |
17 |
18 |
19 |
This account has been locked out, please try again later.
20 |
21 |
22 |
23 | End Function
24 |
25 | End Class
26 | End Namespace
--------------------------------------------------------------------------------
/eShopOnWeb.vazor/Web.VB/Views/Manage/Disable2fa.cshtml:
--------------------------------------------------------------------------------
1 | @* *@
8 | @{ ViewData["Title"] = "Disable two-factor authentication (2FA)"; }
9 | @{
10 | ViewData[ManageNavPages.ActivePageKey] = ManageNavPages.TwoFactorAuthentication;
11 | }
12 |
13 | @ViewData["Title"]
14 |
15 |
16 |
17 |
18 | This action only disables 2FA.
19 |
20 |
21 | Disabling 2FA does not change the keys used in authenticator apps. If you wish to change the key
22 | used in an authenticator app you should
23 | reset your
24 | authenticator keys.
25 |
26 |
12 | Disabling 2FA does not change the keys used in authenticator apps. If you wish to change the key
13 | used in an authenticator app you should
14 | reset your
15 | authenticator keys.
16 |
17 |
18 |
19 |
20 |
21 |
24 |
25 |
--------------------------------------------------------------------------------
/eShopOnWeb.vazor/Web.VB/Views/Manage/ExternalLogins.vazor.vb:
--------------------------------------------------------------------------------
1 | Imports Microsoft.AspNetCore.Mvc.ViewFeatures
2 | Imports Microsoft.eShopWeb.Web.ViewModels.Manage
3 | Imports Vazor
4 |
5 | Public Class ExternalLoginsView
6 | Inherits VazorView
7 |
8 | Public ReadOnly Property Model As Object
9 |
10 | Public ReadOnly Property ViewData() As ViewDataDictionary
11 |
12 | Public Sub New(model As ExternalLoginsViewModel, viewData As ViewDataDictionary)
13 | MyBase.New("ExternalLogins", "Views\Home", "Hello")
14 | Me.Model = model
15 | Me.ViewData = viewData
16 | viewData(Views.Manage.ActivePageKey) = Views.Manage.ExternalLogins
17 |
18 | End Sub
19 |
20 | Public Shared Function CreateNew(model As ExternalLoginsViewModel, viewData As ViewDataDictionary) As String
21 | Return VazorViewMapper.Add(New ExternalLoginsView(model, viewData))
22 | End Function
23 |
24 | End Class
25 |
--------------------------------------------------------------------------------
/eShopOnWeb.vazor/Web.VB/Views/Manage/GenerateRecoveryCodes.zml:
--------------------------------------------------------------------------------
1 |
2 | Recovery codes
3 |
4 |
5 |
6 |
7 |
8 |
9 | Put these codes in a safe place.
10 |
11 |
12 | If you lose your device and don't have the recovery codes you will lose access to your account.
13 |
7 |
8 | If you reset your authenticator key your authenticator app will not work until you reconfigure it.
9 |
10 |
11 | This process disables 2FA until you verify your authenticator app and will also reset your 2FA recovery codes.
12 | If you do not complete your authenticator app configuration you may lose access to your account.
13 |
14 |
15 |
16 |
19 |
--------------------------------------------------------------------------------
/eShopOnWeb.vazor/Web.VB/Views/Manage/_Layout.vbxml.vb:
--------------------------------------------------------------------------------
1 |
2 | Imports Vazor
3 |
4 | Namespace Views.Manage
5 |
6 | Public Class LayoutView
7 | Inherits VazorSharedView
8 |
9 | Public Sub New()
10 | MyBase.New("_Layout", "Views\Manage", "Layout")
11 | End Sub
12 |
13 | Public Overrides Function GetVbXml() As XElement
14 | Return _
15 |
16 |
17 |
18 |
13 | Swapping to Development environment will display more detailed information about the error that occurred.
14 |
15 |
16 | Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application.
17 |
8 | Swapping to Development environment will display more detailed information about the error that occurred.
9 |
10 |
11 | Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application.
12 |