├── .gitignore ├── AngularHeroes ├── .browserslist ├── .editorconfig ├── .gitignore ├── .vscode │ ├── extensions.json │ ├── launch.json │ └── tasks.json ├── HeroesDemo.esproj ├── OnBoardingIndex.html ├── README.md ├── angular.json ├── buildDev.ps1 ├── buildProd.ps1 ├── e2e │ ├── protractor.conf.js │ ├── src │ │ ├── app.e2e-spec.ts │ │ └── app.po.ts │ └── tsconfig.json ├── karma.conf.js ├── nuget.config ├── package.json ├── src │ ├── app │ │ ├── app-routing.module.ts │ │ ├── app.component.css │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── dashboard │ │ │ ├── dashboard.component.css │ │ │ ├── dashboard.component.html │ │ │ └── dashboard.component.ts │ │ ├── hero-detail │ │ │ ├── hero-detail.component.css │ │ │ ├── hero-detail.component.html │ │ │ └── hero-detail.component.ts │ │ ├── hero-search │ │ │ ├── hero-search.component.css │ │ │ ├── hero-search.component.html │ │ │ └── hero-search.component.ts │ │ ├── heroes │ │ │ ├── heroes.component.css │ │ │ ├── heroes.component.html │ │ │ └── heroes.component.ts │ │ ├── message.service.ts │ │ └── messages │ │ │ ├── messages.component.css │ │ │ ├── messages.component.html │ │ │ └── messages.component.ts │ ├── clientapi │ │ ├── WebApiCoreNg2ClientAuto.ts │ │ └── WebApiNG2ClientAuto.spec.ts │ ├── conf │ │ ├── siteconfig.js │ │ └── siteconfigProd.js │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── locales │ │ ├── messages.es.xlf │ │ ├── messages.ja.xlf │ │ ├── messages.xlf │ │ ├── messages.zh-hans.xlf │ │ └── messages.zh-hant.xlf │ ├── main.ts │ └── styles.css ├── startDev.ps1 ├── startProd.ps1 ├── tsconfig.app.json ├── tsconfig.json └── tsconfig.spec.json ├── AureliaHeroes ├── .editorconfig ├── .eslintrc.json ├── .gitignore ├── .npmrc ├── .vscode │ ├── extensions.json │ ├── launch.json │ └── settings.json ├── README.md ├── aurelia_project │ ├── aurelia.json │ ├── generators │ │ ├── attribute.json │ │ ├── attribute.ts │ │ ├── binding-behavior.json │ │ ├── binding-behavior.ts │ │ ├── component.json │ │ ├── component.ts │ │ ├── element.json │ │ ├── element.ts │ │ ├── generator.json │ │ ├── generator.ts │ │ ├── task.json │ │ ├── task.ts │ │ ├── value-converter.json │ │ └── value-converter.ts │ └── tasks │ │ ├── build.json │ │ ├── build.ts │ │ ├── jest.json │ │ ├── jest.ts │ │ ├── run.json │ │ ├── run.ts │ │ ├── test.json │ │ └── test.ts ├── config │ ├── environment.json │ └── environment.production.json ├── index.ejs ├── package.json ├── src │ ├── app.html │ ├── app.ts │ ├── clientapi │ │ └── WebApiCoreAureliaClientAuto.ts │ ├── components │ │ ├── dashboard.css │ │ ├── dashboard.html │ │ ├── dashboard.ts │ │ ├── hero-detail.css │ │ ├── hero-detail.html │ │ ├── hero-detail.ts │ │ ├── heroes.css │ │ ├── heroes.html │ │ └── heroes.ts │ ├── main.ts │ ├── resources │ │ └── index.ts │ └── styles.css ├── startApp.bat ├── static │ └── favicon.ico ├── test │ ├── jest-pretest.ts │ └── unit │ │ └── app.spec.ts ├── tsconfig.json └── webpack.config.js ├── BlazorHeroesWA ├── BlazorHeroesWA.Client │ ├── BlazorHeroesWA.Client.csproj │ ├── Pages │ │ └── Counter.razor │ ├── Program.cs │ ├── _Imports.razor │ └── wwwroot │ │ ├── appsettings.Development.json │ │ └── appsettings.json └── BlazorHeroesWA │ ├── BlazorHeroesWA.csproj │ ├── Components │ ├── App.razor │ ├── Layout │ │ ├── MainLayout.razor │ │ ├── MainLayout.razor.css │ │ ├── NavMenu.razor │ │ └── NavMenu.razor.css │ ├── Pages │ │ ├── Error.razor │ │ ├── Home.razor │ │ └── Weather.razor │ ├── Routes.razor │ └── _Imports.razor │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ ├── appsettings.Development.json │ ├── appsettings.json │ └── wwwroot │ ├── app.css │ ├── bootstrap │ └── bootstrap.min.css │ └── favicon.png ├── BlazorHeroesWAStandalone ├── App.razor ├── BlazorHeroesWAStandalone.csproj ├── Layout │ ├── MainLayout.razor │ ├── MainLayout.razor.css │ ├── NavMenu.razor │ └── NavMenu.razor.css ├── Pages │ ├── Counter.razor │ ├── Dashboard.razor │ ├── Dashboard.razor.css │ ├── HeroDetail.razor │ ├── HeroDetail.razor.css │ ├── Heroes.razor │ ├── Heroes.razor.css │ ├── Home.razor │ └── Weather.razor ├── Program.cs ├── Properties │ └── launchSettings.json ├── README.md ├── _Imports.razor └── wwwroot │ ├── css │ ├── app.css │ └── bootstrap │ │ └── bootstrap.min.css │ ├── favicon.png │ ├── icon-192.png │ ├── icon-512.png │ ├── index.html │ ├── manifest.webmanifest │ ├── sample-data │ └── weather.json │ ├── service-worker.js │ └── service-worker.published.js ├── BlazorHeroesWeb ├── BlazorHeroesWeb.csproj ├── Components │ ├── App.razor │ ├── Layout │ │ ├── MainLayout.razor │ │ ├── MainLayout.razor.css │ │ ├── NavMenu.razor │ │ └── NavMenu.razor.css │ ├── Pages │ │ ├── Counter.razor │ │ ├── Error.razor │ │ ├── Home.razor │ │ └── Weather.razor │ ├── Routes.razor │ └── _Imports.razor ├── Program.cs ├── Properties │ └── launchSettings.json ├── appsettings.Development.json ├── appsettings.json └── wwwroot │ ├── app.css │ ├── bootstrap │ └── bootstrap.min.css │ └── favicon.png ├── Core3Mvc ├── CodeGen.json ├── Controllers │ └── HomeController.cs ├── Core3Mvc.csproj ├── Models │ └── ErrorViewModel.cs ├── Program.cs ├── Properties │ └── launchSettings.json ├── Startup.cs ├── Views │ ├── Home │ │ ├── Index.cshtml │ │ └── Privacy.cshtml │ ├── Shared │ │ ├── Error.cshtml │ │ ├── _Layout.cshtml │ │ └── _ValidationScriptsPartial.cshtml │ ├── _ViewImports.cshtml │ └── _ViewStart.cshtml ├── appsettings.Development.json ├── appsettings.json └── wwwroot │ ├── css │ └── site.css │ ├── favicon.ico │ ├── js │ └── site.js │ └── lib │ ├── bootstrap │ ├── LICENSE │ └── dist │ │ ├── css │ │ ├── bootstrap-grid.css │ │ ├── bootstrap-grid.min.css │ │ ├── bootstrap-reboot.css │ │ ├── bootstrap-reboot.min.css │ │ ├── bootstrap.css │ │ └── bootstrap.min.css │ │ └── js │ │ ├── bootstrap.bundle.js │ │ ├── bootstrap.bundle.min.js │ │ ├── bootstrap.js │ │ └── bootstrap.min.js │ ├── jquery-validation-unobtrusive │ ├── LICENSE.txt │ ├── jquery.validate.unobtrusive.js │ └── jquery.validate.unobtrusive.min.js │ ├── jquery-validation │ ├── LICENSE.md │ └── dist │ │ ├── additional-methods.js │ │ ├── additional-methods.min.js │ │ ├── jquery.validate.js │ │ └── jquery.validate.min.js │ └── jquery │ ├── LICENSE.txt │ └── dist │ ├── jquery.js │ └── jquery.min.js ├── Core3WebApi ├── CodeGen.json ├── CodeGenSchema.json ├── Controllers │ ├── StatisticsController.cs │ └── WeatherForecastController.cs ├── Core3WebApi.csproj ├── Program.cs ├── Properties │ └── launchSettings.json ├── WeatherForecast.cs ├── appsettings.Development.json └── appsettings.json ├── CoreWebApi.ClientApi ├── CoreWebApi.ClientApi.csproj └── WebApiClientAuto.cs ├── CreateMvc3ClientApi.ps1 ├── CreateWebApiClientApi3.ps1 ├── DemoCoreWeb.sln ├── DemoCoreWebControllers ├── Controllers │ ├── CodeGenController.cs │ ├── DateTypesController.cs │ ├── EntitiesController.cs │ ├── FileUploadController.cs │ ├── HeroesController.cs │ ├── HomeController.cs │ ├── NumbersController.cs │ ├── SpecialTypesController.cs │ ├── StringDataController.cs │ ├── SuperDemoController.cs │ ├── TextDataController.cs │ ├── TupleController.cs │ └── ValuesController.cs ├── DemoCoreWebControllers.csproj └── Helpers │ └── ErrorHandlingMiddleware.cs ├── DemoWebApi.DemoDataCore ├── AccountBindingModels.cs ├── AccountViewModels.cs ├── DemoWebApi.DemoDataCore.csproj └── Entities.cs ├── Docs ├── Generate C# Client API for ASP.NET Core Web API - CodeProject.html └── Generate C# Client API for ASP.NET Core Web API - CodeProject_files │ ├── 6839 │ ├── 15993272203953158972 │ ├── 4bd1b696-4098621b6d81f3cf.js.download │ ├── 6528562391515211296 │ ├── 684-7067fe44ff85ebe6.js.download │ ├── 869-095b567be01917e3.js.download │ ├── AGSKWxU8WO1OL5TJZ4N-z2tYi5p7xQ7CH7KI0ECgA0PKZrlkOPewtgp2o4S2j2ml9DfK82efxwl47SpNo28wsZfeGrNFw2ZkpEGncpKkub-xgeBK7BheTXtcc9sonZk6mL6VFxc2-zjMqQ== │ ├── AGSKWxUcYQd9k0uAgWyBThwG73wIAqCt1hduT0VPAbXF0UhQt-8Yxv0tkzDyhMIjWd8SefJIOTTv0GBmFh1efwd2wYTaqbnx-JJKECZpUfqEXre1NhdK0sCaOV1pagt0fBiHI7eHm3MGMg== │ ├── AGSKWxX3sVBtw0o_9mVVXVz2buEdGxoNETpk44sov4Lc_rSo2JI_NiI1UnBCOK1tyfmmW0Zb6hih2UU2LaKr5OXviFVadk0OZbzdcAH_JXsitlwV_I5XuRI31E_c7eJomX3WxvC_4t8SLQ== │ ├── aframe.html │ ├── f(1).txt │ ├── f(2).txt │ ├── f(3).txt │ ├── f(4).txt │ ├── f.txt │ ├── f00fbee724adea66.css │ ├── js │ ├── l │ ├── layout-12dfdcc6fc1e5fcf.js.download │ ├── logo250x135.gif │ ├── main-app-f38f0d9153b95312.js.download │ ├── page-ade9d0789736a960.js.download │ ├── polyfills-42372ed130431b0a.js.download │ ├── reach_worklet(1).html │ ├── reach_worklet.html │ ├── saved_resource(1).html │ ├── saved_resource(2).html │ ├── saved_resource(3).html │ ├── saved_resource(4).html │ ├── saved_resource(5).html │ ├── saved_resource(6).html │ ├── saved_resource.html │ ├── sodar │ ├── starIcon.png │ ├── topics_frame.html │ ├── viewsIcon.png │ └── webpack-5ed466aeca77ac7a.js.download ├── HeroesMvc ├── Controllers │ └── HomeController.cs ├── HeroesMvc.csproj ├── Models │ └── ErrorViewModel.cs ├── Program.cs ├── Properties │ └── launchSettings.json ├── Views │ ├── Home │ │ ├── Index.cshtml │ │ └── Privacy.cshtml │ ├── Shared │ │ ├── Error.cshtml │ │ ├── _Layout.cshtml │ │ ├── _Layout.cshtml.css │ │ └── _ValidationScriptsPartial.cshtml │ ├── _ViewImports.cshtml │ └── _ViewStart.cshtml ├── appsettings.Development.json ├── appsettings.json └── wwwroot │ ├── css │ └── site.css │ ├── favicon.ico │ ├── js │ └── site.js │ └── lib │ ├── bootstrap │ ├── LICENSE │ └── dist │ │ ├── css │ │ ├── bootstrap-grid.css │ │ ├── bootstrap-grid.min.css │ │ ├── bootstrap-grid.rtl.css │ │ ├── bootstrap-grid.rtl.min.css │ │ ├── bootstrap-reboot.css │ │ ├── bootstrap-reboot.min.css │ │ ├── bootstrap-reboot.rtl.css │ │ ├── bootstrap-reboot.rtl.min.css │ │ ├── bootstrap-utilities.css │ │ ├── bootstrap-utilities.min.css │ │ ├── bootstrap-utilities.rtl.css │ │ ├── bootstrap-utilities.rtl.min.css │ │ ├── bootstrap.css │ │ ├── bootstrap.min.css │ │ ├── bootstrap.rtl.css │ │ └── bootstrap.rtl.min.css │ │ └── js │ │ ├── bootstrap.bundle.js │ │ ├── bootstrap.bundle.min.js │ │ ├── bootstrap.esm.js │ │ ├── bootstrap.esm.min.js │ │ ├── bootstrap.js │ │ └── bootstrap.min.js │ ├── jquery-validation-unobtrusive │ ├── LICENSE.txt │ └── dist │ │ ├── jquery.validate.unobtrusive.js │ │ └── jquery.validate.unobtrusive.min.js │ ├── jquery-validation │ ├── LICENSE.md │ └── dist │ │ ├── additional-methods.js │ │ ├── additional-methods.min.js │ │ ├── jquery.validate.js │ │ └── jquery.validate.min.js │ └── jquery │ ├── LICENSE.txt │ └── dist │ ├── jquery.js │ ├── jquery.min.js │ ├── jquery.slim.js │ └── jquery.slim.min.js ├── HeroesRazor ├── HeroesRazor.csproj ├── Pages │ ├── Dashboard.cshtml │ ├── Dashboard.cshtml.cs │ ├── Dashboard.cshtml.css │ ├── Error.cshtml │ ├── Error.cshtml.cs │ ├── HeroDetail.cshtml │ ├── HeroDetail.cshtml.cs │ ├── HeroDetail.cshtml.css │ ├── HeroDetail.razor │ ├── HeroDetail.razor.css │ ├── Heroes.cshtml │ ├── Heroes.cshtml.cs │ ├── Heroes.cshtml.css │ ├── Index.cshtml │ ├── Index.cshtml.cs │ ├── Privacy.cshtml │ ├── Privacy.cshtml.cs │ ├── Shared │ │ ├── _Layout.cshtml │ │ ├── _Layout.cshtml.css │ │ └── _ValidationScriptsPartial.cshtml │ ├── _ViewImports.cshtml │ └── _ViewStart.cshtml ├── Program.cs ├── Properties │ └── launchSettings.json ├── appsettings.Development.json ├── appsettings.json └── wwwroot │ ├── css │ └── site.css │ ├── favicon.ico │ ├── js │ └── site.js │ └── lib │ ├── bootstrap │ ├── LICENSE │ └── dist │ │ ├── css │ │ ├── bootstrap-grid.css │ │ ├── bootstrap-grid.min.css │ │ ├── bootstrap-grid.rtl.css │ │ ├── bootstrap-grid.rtl.min.css │ │ ├── bootstrap-reboot.css │ │ ├── bootstrap-reboot.min.css │ │ ├── bootstrap-reboot.rtl.css │ │ ├── bootstrap-reboot.rtl.min.css │ │ ├── bootstrap-utilities.css │ │ ├── bootstrap-utilities.min.css │ │ ├── bootstrap-utilities.rtl.css │ │ ├── bootstrap-utilities.rtl.min.css │ │ ├── bootstrap.css │ │ ├── bootstrap.min.css │ │ ├── bootstrap.rtl.css │ │ └── bootstrap.rtl.min.css │ │ └── js │ │ ├── bootstrap.bundle.js │ │ ├── bootstrap.bundle.min.js │ │ ├── bootstrap.esm.js │ │ ├── bootstrap.esm.min.js │ │ ├── bootstrap.js │ │ └── bootstrap.min.js │ ├── jquery-validation-unobtrusive │ ├── LICENSE.txt │ └── dist │ │ ├── jquery.validate.unobtrusive.js │ │ └── jquery.validate.unobtrusive.min.js │ ├── jquery-validation │ ├── LICENSE.md │ └── dist │ │ ├── additional-methods.js │ │ ├── additional-methods.min.js │ │ ├── jquery.validate.js │ │ └── jquery.validate.min.js │ └── jquery │ ├── LICENSE.txt │ └── dist │ ├── jquery.js │ ├── jquery.min.js │ ├── jquery.slim.js │ └── jquery.slim.min.js ├── MauiMulti └── MauiHeroes │ ├── MauiHeroes.Droid │ ├── AndroidManifest.xml │ ├── Assets │ │ └── AboutAndroidAssets.txt │ ├── MainActivity.cs │ ├── MainAndroidApplication.cs │ ├── MauiAndroidProgram.cs │ ├── MauiHeroes.Droid.csproj │ └── Resources │ │ ├── AboutAndroidResources.txt │ │ ├── drawable-hdpi │ │ └── dotnet_bot_devices.png │ │ ├── drawable-mdpi │ │ └── dotnet_bot_devices.png │ │ ├── drawable-xhdpi │ │ └── dotnet_bot_devices.png │ │ ├── drawable-xxhdpi │ │ └── dotnet_bot_devices.png │ │ ├── drawable-xxxhdpi │ │ └── dotnet_bot_devices.png │ │ ├── mipmap-anydpi-v26 │ │ ├── appicon.xml │ │ └── appicon_round.xml │ │ ├── mipmap-hdpi │ │ ├── appicon.png │ │ ├── appicon_background.png │ │ └── appicon_foreground.png │ │ ├── mipmap-mdpi │ │ ├── appicon.png │ │ ├── appicon_background.png │ │ └── appicon_foreground.png │ │ ├── mipmap-xhdpi │ │ ├── appicon.png │ │ ├── appicon_background.png │ │ └── appicon_foreground.png │ │ ├── mipmap-xxhdpi │ │ ├── appicon.png │ │ ├── appicon_background.png │ │ └── appicon_foreground.png │ │ ├── mipmap-xxxhdpi │ │ ├── appicon.png │ │ ├── appicon_background.png │ │ └── appicon_foreground.png │ │ ├── storyboard1536x2048.svg │ │ └── values │ │ ├── colors.xml │ │ └── strings.xml │ ├── MauiHeroes.Mac │ ├── AppDelegate.cs │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon1024.png │ │ │ ├── Icon128.png │ │ │ ├── Icon16.png │ │ │ ├── Icon256.png │ │ │ ├── Icon32.png │ │ │ ├── Icon512.png │ │ │ └── Icon64.png │ ├── Entitlements.plist │ ├── Info.plist │ ├── Main.cs │ ├── MauiHeroes.Mac.csproj │ ├── MauiProgram.cs │ └── Resources │ │ ├── AboutMacCatalystResources.txt │ │ ├── LaunchScreen.xib │ │ ├── dotnet_bot_devices.png │ │ ├── dotnet_bot_devices@2x.png │ │ └── dotnet_bot_devices@3x.png │ ├── MauiHeroes.WinUI │ ├── App.xaml │ ├── App.xaml.cs │ ├── Assets │ │ ├── AboutWinUIAssets.txt │ │ ├── Images │ │ │ ├── AboutWinUIImages.txt │ │ │ ├── dotnet_bot_devices.scale-100.png │ │ │ ├── dotnet_bot_devices.scale-125.png │ │ │ ├── dotnet_bot_devices.scale-150.png │ │ │ ├── dotnet_bot_devices.scale-200.png │ │ │ └── dotnet_bot_devices.scale-400.png │ │ ├── LockScreenLogo.scale-200.png │ │ ├── SplashScreen.scale-200.png │ │ ├── Square150x150Logo.scale-200.png │ │ ├── Square44x44Logo.scale-200.png │ │ ├── Square44x44Logo.targetsize-24_altform-unplated.png │ │ ├── StoreLogo.png │ │ └── Wide310x150Logo.scale-200.png │ ├── MauiHeroes.WinUI.csproj │ ├── MauiProgram.cs │ ├── Package.appxmanifest │ ├── Properties │ │ ├── PublishProfiles │ │ │ ├── win10-arm64.pubxml │ │ │ ├── win10-x64.pubxml │ │ │ └── win10-x86.pubxml │ │ └── launchSettings.json │ └── app.manifest │ ├── MauiHeroes.iOS │ ├── AppDelegate.cs │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon1024.png │ │ │ ├── Icon120.png │ │ │ ├── Icon152.png │ │ │ ├── Icon167.png │ │ │ ├── Icon180.png │ │ │ ├── Icon20.png │ │ │ ├── Icon29.png │ │ │ ├── Icon40.png │ │ │ ├── Icon58.png │ │ │ ├── Icon60.png │ │ │ ├── Icon76.png │ │ │ ├── Icon80.png │ │ │ └── Icon87.png │ ├── Entitlements.plist │ ├── Info.plist │ ├── Main.cs │ ├── MauiHeroes.iOS.csproj │ ├── MauiProgram.cs │ └── Resources │ │ ├── AboutiOSResources.txt │ │ ├── LaunchScreen.storyboard │ │ ├── LaunchScreen.xib │ │ ├── dotnet_bot_devices.png │ │ ├── dotnet_bot_devices@2x.png │ │ ├── dotnet_bot_devices@3x.png │ │ └── storyboard1536x2048.svg │ └── MauiHeroes │ ├── App.xaml │ ├── App.xaml.cs │ ├── MauiHeroes.csproj │ ├── MauiProgramExtensions.cs │ └── Resources │ ├── AppIcon │ ├── appicon.svg │ └── appiconfg.svg │ ├── Fonts │ ├── OpenSans-Regular.ttf │ └── OpenSans-Semibold.ttf │ ├── Images │ └── dotnet_bot.svg │ ├── Raw │ └── AboutAssets.txt │ ├── Splash │ └── splash.svg │ └── Styles │ ├── Colors.xaml │ └── Styles.xaml ├── README.md ├── ReactHeroes ├── .gitignore ├── README.md ├── jest.config.js ├── package.json ├── public │ ├── favicon.ico │ ├── index.html │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ └── robots.txt ├── src │ ├── Api.test.tsx │ ├── App.css │ ├── App.tsx │ ├── Dashboard.css │ ├── Dashboard.tsx │ ├── Demo.tsx │ ├── HeroDetail.css │ ├── HeroDetail.tsx │ ├── Heroes.css │ ├── Heroes.tsx │ ├── HeroesApi.tsx │ ├── Home.tsx │ ├── clientapi │ │ └── WebApiCoreAxiosClientAuto.ts │ ├── index.css │ ├── index.tsx │ ├── logo.svg │ ├── react-app-env.d.ts │ ├── reportWebVitals.ts │ └── setupTests.ts ├── startApp.bat └── tsconfig.json ├── RealWorldExamples └── PoetryManagementAndPublishing │ └── WebApiNG2ClientAuto.ts ├── StartCoreMvc.ps1 ├── StartCoreWebApi.ps1 ├── Tests └── IntegrationTestsTextJson │ ├── BigIntConverter.cs │ ├── DateTypesFixture.cs │ ├── DateTypesIntegration.cs │ ├── DotNetCoreSpecial.cs │ ├── DotNetHostCollection.cs │ ├── EntitiesApiIntegration.cs │ ├── EntitiesFixture.cs │ ├── FileUploadIntegration.cs │ ├── HeroesApiIntegration.cs │ ├── HeroesFixture.cs │ ├── IntegrationTestsTextJson.csproj │ ├── NumbersApiIntegration.cs │ ├── NumbersFixture.cs │ ├── README.md │ ├── SpecialTypesApiIntegration.cs │ ├── SpecialTypesFixture.cs │ ├── StringDataApiIntegration.cs │ ├── StringDataFixture.cs │ ├── SuperDemoFixture.cs │ ├── SuperDemoIntegration.cs │ ├── TextDataApiIntegrationy.cs │ ├── TextDataFixture.cs │ ├── TextJsonNegativeCases.cs │ ├── TupleApiIntegration.cs │ ├── TupleFixture.cs │ ├── ValuesApiIntegration.cs │ ├── ValuesFixture.cs │ ├── WeatherForecastFixture.cs │ ├── WeatherForecastIntegration.cs │ └── appsettings.json ├── fetchapi ├── karma.conf.js ├── package-lock.json ├── package.json ├── readme.txt ├── src │ ├── app.spec.ts │ └── clientapi │ │ └── WebApiCoreFetchClientAuto.ts └── tsconfig.json ├── mobile ├── Fonlow.MauiHeroes.ViewModels │ ├── ClientApiSingleton.cs │ ├── Fonlow.MauiHeroes.ViewModels.csproj │ └── Heroes.cs ├── Fonlow.MauiHeroes.Views │ ├── Dashboard.xaml │ ├── Dashboard.xaml.cs │ ├── Fonlow.MauiHeroes.Views.csproj │ ├── HeroDetailPage.xaml │ ├── HeroDetailPage.xaml.cs │ ├── HeroSearch.xaml │ ├── HeroSearch.xaml.cs │ ├── HeroesView.xaml │ ├── HeroesView.xaml.cs │ ├── MainPage.xaml │ ├── MainPage.xaml.cs │ ├── MainTabbedPage.xaml │ └── MainTabbedPage.xaml.cs └── Fonlow.MauiHeroes │ ├── App.xaml │ ├── App.xaml.cs │ ├── Fonlow.MauiHeroes.csproj │ ├── MauiProgram.cs │ ├── Platforms │ ├── Android │ │ ├── AndroidManifest.xml │ │ ├── MainActivity.cs │ │ ├── MainApplication.cs │ │ └── Resources │ │ │ └── values │ │ │ └── colors.xml │ ├── MacCatalyst │ │ ├── AppDelegate.cs │ │ ├── Entitlements.plist │ │ ├── Info.plist │ │ └── Program.cs │ ├── Tizen │ │ ├── Main.cs │ │ └── tizen-manifest.xml │ ├── Windows │ │ ├── App.xaml │ │ ├── App.xaml.cs │ │ ├── Package.appxmanifest │ │ └── app.manifest │ └── iOS │ │ ├── AppDelegate.cs │ │ ├── Info.plist │ │ └── Program.cs │ ├── Properties │ └── launchSettings.json │ └── Resources │ ├── AppIcon │ ├── appicon.svg │ └── appiconfg.svg │ ├── Fonts │ ├── OpenSans-Regular.ttf │ └── OpenSans-Semibold.ttf │ ├── Images │ └── dotnet_bot.png │ ├── Raw │ └── AboutAssets.txt │ ├── Splash │ └── splash.svg │ └── Styles │ ├── Colors.xaml │ └── Styles.xaml └── vueTS ├── .browserslistrc ├── .gitignore ├── README.md ├── jest.config.js ├── package-lock.json ├── package.json ├── postcss.config.js ├── public ├── favicon.ico └── index.html ├── src ├── App.vue ├── assets │ └── logo.png ├── clientapi │ └── WebApiCoreAxiosClientAuto.ts ├── components │ └── HelloWorld.vue ├── main.ts ├── shims-tsx.d.ts ├── shims-vue.d.ts └── store.ts ├── tests └── unit │ └── All.spec.ts ├── tsconfig.json └── tslint.json /.gitignore: -------------------------------------------------------------------------------- 1 | *.dll 2 | *.exe 3 | *.pdb 4 | #ignore thumbnails created by windows 5 | Thumbs.db 6 | #Ignore files build by Visual Studio 7 | *.obj 8 | *.user 9 | *.aps 10 | *.pch 11 | *.vspscc 12 | *_i.c 13 | *_p.c 14 | *.ncb 15 | *.suo 16 | *.tlb 17 | *.tlh 18 | *.bak 19 | *.cache 20 | *.ilk 21 | *.log 22 | *.map 23 | [Bb]in 24 | [Dd]ebug*/ 25 | *.lib 26 | *.sbr 27 | obj/ 28 | [Rr]elease*/ 29 | _ReSharper*/ 30 | [Tt]est[Rr]esult* 31 | /Fonlow.Oc.WebApi/App_Data 32 | .vs 33 | /DemoAngularJs2/node_modules 34 | /DemoAngular2/node_modules 35 | /DemoWebApi/App_Data/*.ldf 36 | /DemoWebApi/App_Data/*.mdf 37 | /packages 38 | /DemoNGCli/NG 39 | /axios/node_modules 40 | /fetchapi/coverage 41 | /fetchapi/node_modules 42 | /AngularHeroes/package-lock.json 43 | /ngdist 44 | /ReactHeroes/package-lock.json 45 | /AureliaHeroes/package-lock.json 46 | -------------------------------------------------------------------------------- /AngularHeroes/.browserslist: -------------------------------------------------------------------------------- 1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below. 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | 5 | # For the full list of supported browsers by the Angular framework, please see: 6 | # https://angular.io/guide/browser-support 7 | 8 | # You can see what browsers were selected by your queries by running: 9 | # npx browserslist 10 | 11 | last 3 Chrome version 12 | last 3 Firefox version 13 | last 2 Edge major versions 14 | last 2 Safari major versions 15 | last 2 iOS major versions 16 | Firefox ESR 17 | -------------------------------------------------------------------------------- /AngularHeroes/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = tab 7 | indent_size = 4 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.ts] 12 | quote_type = single 13 | 14 | [*.md] 15 | max_line_length = off 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /AngularHeroes/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # Compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | /bazel-out 8 | 9 | # Node 10 | /node_modules 11 | npm-debug.log 12 | yarn-error.log 13 | 14 | # IDEs and editors 15 | .idea/ 16 | .project 17 | .classpath 18 | .c9/ 19 | *.launch 20 | .settings/ 21 | *.sublime-workspace 22 | 23 | # Visual Studio Code 24 | .vscode/* 25 | !.vscode/settings.json 26 | !.vscode/tasks.json 27 | !.vscode/launch.json 28 | !.vscode/extensions.json 29 | .history/* 30 | 31 | # Miscellaneous 32 | /.angular/cache 33 | .sass-cache/ 34 | /connect.lock 35 | /coverage 36 | /libpeerconnection.log 37 | testem.log 38 | /typings 39 | 40 | # System files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /AngularHeroes/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 3 | "recommendations": ["angular.ng-template"] 4 | } 5 | -------------------------------------------------------------------------------- /AngularHeroes/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "type": "edge", 6 | "request": "launch", 7 | "name": "localhost (Edge)", 8 | "url": "http://localhost:4200", 9 | "webRoot": "${workspaceFolder}" 10 | }, 11 | { 12 | "type": "chrome", 13 | "request": "launch", 14 | "name": "localhost (Chrome)", 15 | "url": "http://localhost:4200", 16 | "webRoot": "${workspaceFolder}" 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /AngularHeroes/HeroesDemo.esproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | npm start 4 | Jasmine 5 | 8 | 9 | -------------------------------------------------------------------------------- /AngularHeroes/buildDev.ps1: -------------------------------------------------------------------------------- 1 | cd $PSScriptRoot 2 | ng build --configuration=dev -------------------------------------------------------------------------------- /AngularHeroes/buildProd.ps1: -------------------------------------------------------------------------------- 1 | Set-Location $PSScriptRoot 2 | ng build --configuration=production --localize 3 | copy-item .\OnBoardingIndex.html -Destination '../ngdist/prod/browser/index.html' 4 | Write-Output 'done' -------------------------------------------------------------------------------- /AngularHeroes/e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | // Protractor configuration file, see link for more information 3 | // https://github.com/angular/protractor/blob/master/lib/config.ts 4 | 5 | const { SpecReporter, StacktraceOption } = require('jasmine-spec-reporter'); 6 | 7 | /** 8 | * @type { import("protractor").Config } 9 | */ 10 | exports.config = { 11 | allScriptsTimeout: 11000, 12 | specs: [ 13 | './src/**/*.e2e-spec.ts' 14 | ], 15 | capabilities: { 16 | browserName: 'chrome' 17 | }, 18 | directConnect: true, 19 | SELENIUM_PROMISE_MANAGER: false, 20 | baseUrl: 'http://localhost:4200/', 21 | framework: 'jasmine', 22 | jasmineNodeOpts: { 23 | showColors: true, 24 | defaultTimeoutInterval: 30000, 25 | print: function() {} 26 | }, 27 | onPrepare() { 28 | require('ts-node').register({ 29 | project: require('path').join(__dirname, './tsconfig.json') 30 | }); 31 | jasmine.getEnv().addReporter(new SpecReporter({ 32 | spec: { 33 | displayStacktrace: StacktraceOption.PRETTY 34 | } 35 | })); 36 | } 37 | }; 38 | -------------------------------------------------------------------------------- /AngularHeroes/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | async navigateTo(): Promise { 5 | return browser.get(browser.baseUrl); 6 | } 7 | 8 | async getTitleText(): Promise { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /AngularHeroes/e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../out-tsc/e2e", 6 | "module": "commonjs", 7 | "target": "es2018", 8 | "types": [ 9 | "jasmine", 10 | "node" 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /AngularHeroes/nuget.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /AngularHeroes/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { RouterModule, Routes } from '@angular/router'; 3 | 4 | import { DashboardComponent } from './dashboard/dashboard.component'; 5 | import { HeroesComponent } from './heroes/heroes.component'; 6 | import { HeroDetailComponent } from './hero-detail/hero-detail.component'; 7 | 8 | const routes: Routes = [ 9 | { path: '', redirectTo: '/dashboard', pathMatch: 'full' }, 10 | { path: 'dashboard', component: DashboardComponent }, 11 | { path: 'detail/:id', component: HeroDetailComponent }, 12 | { path: 'heroes', component: HeroesComponent } 13 | ]; 14 | 15 | @NgModule({ 16 | imports: [ RouterModule.forRoot(routes) ], 17 | exports: [ RouterModule ] 18 | }) 19 | export class AppRoutingModule {} 20 | -------------------------------------------------------------------------------- /AngularHeroes/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | /* AppComponent's private CSS styles */ 2 | h1 { 3 | margin-bottom: 0; 4 | } 5 | nav a { 6 | padding: 1rem; 7 | text-decoration: none; 8 | margin-top: 10px; 9 | display: inline-block; 10 | background-color: #e8e8e8; 11 | color: #3d3d3d; 12 | border-radius: 4px; 13 | } 14 | nav a:hover { 15 | color: white; 16 | background-color: #42545C; 17 | } 18 | nav a.active { 19 | background-color: black; 20 | } 21 | -------------------------------------------------------------------------------- /AngularHeroes/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |

{{title}}

2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AngularHeroes/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'], 7 | standalone: false 8 | }) 9 | export class AppComponent { 10 | private test='Multiple'; 11 | title = $localize`Tour of ${this.test} Heroes`; 12 | } 13 | -------------------------------------------------------------------------------- /AngularHeroes/src/app/dashboard/dashboard.component.html: -------------------------------------------------------------------------------- 1 |

Top Heroes

2 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /AngularHeroes/src/app/dashboard/dashboard.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Inject, OnInit } from '@angular/core'; 2 | import * as namespaces from '../../clientapi/WebApiCoreNg2ClientAuto'; 3 | 4 | @Component({ 5 | selector: 'app-dashboard', 6 | templateUrl: './dashboard.component.html', 7 | styleUrls: ['./dashboard.component.css'], 8 | standalone: false 9 | }) 10 | export class DashboardComponent implements OnInit { 11 | heroes: namespaces.DemoWebApi_Controllers_Client.Hero[] = []; 12 | 13 | constructor(private heroService: namespaces.DemoWebApi_Controllers_Client.Heroes) { } 14 | 15 | ngOnInit(): void { 16 | this.heroService.getHeroes().subscribe( 17 | { 18 | next: heroes => { 19 | this.heroes = heroes.slice(1, 5); 20 | }, 21 | error: error => console.error(error) 22 | } 23 | ); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /AngularHeroes/src/app/hero-detail/hero-detail.component.css: -------------------------------------------------------------------------------- 1 | /* HeroDetailComponent's private CSS styles */ 2 | label { 3 | color: #435960; 4 | font-weight: bold; 5 | } 6 | input { 7 | font-size: 1em; 8 | padding: .5rem; 9 | } 10 | button { 11 | margin-top: 20px; 12 | margin-right: .5rem; 13 | background-color: #eee; 14 | padding: 1rem; 15 | border-radius: 4px; 16 | font-size: 1rem; 17 | } 18 | button:hover { 19 | background-color: #cfd8dc; 20 | } 21 | button:disabled { 22 | background-color: #eee; 23 | color: #ccc; 24 | cursor: auto; 25 | } 26 | -------------------------------------------------------------------------------- /AngularHeroes/src/app/hero-detail/hero-detail.component.html: -------------------------------------------------------------------------------- 1 |
2 |

{{hero.name | uppercase}} Details

3 |
id: {{hero.id}}
4 |
5 | 6 | 7 |
8 | 9 | 10 | 11 |
12 | -------------------------------------------------------------------------------- /AngularHeroes/src/app/hero-search/hero-search.component.css: -------------------------------------------------------------------------------- 1 | /* HeroSearch private styles */ 2 | 3 | label { 4 | display: block; 5 | font-weight: bold; 6 | font-size: 1.2rem; 7 | margin-top: 1rem; 8 | margin-bottom: .5rem; 9 | 10 | } 11 | input { 12 | padding: .5rem; 13 | width: 100%; 14 | max-width: 600px; 15 | box-sizing: border-box; 16 | display: block; 17 | } 18 | 19 | input:focus { 20 | outline: #336699 auto 1px; 21 | } 22 | 23 | li { 24 | list-style-type: none; 25 | } 26 | .search-result li a { 27 | border-bottom: 1px solid gray; 28 | border-left: 1px solid gray; 29 | border-right: 1px solid gray; 30 | display: inline-block; 31 | width: 100%; 32 | max-width: 600px; 33 | padding: .5rem; 34 | box-sizing: border-box; 35 | text-decoration: none; 36 | color: black; 37 | } 38 | 39 | .search-result li a:hover { 40 | background-color: #435A60; 41 | color: white; 42 | } 43 | 44 | ul.search-result { 45 | margin-top: 0; 46 | padding-left: 0; 47 | } 48 | -------------------------------------------------------------------------------- /AngularHeroes/src/app/hero-search/hero-search.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 12 |
13 | -------------------------------------------------------------------------------- /AngularHeroes/src/app/heroes/heroes.component.html: -------------------------------------------------------------------------------- 1 |

My Heroes

2 | 3 |
4 | 5 | 6 | 7 | 8 | 11 |
12 | 13 | 22 | -------------------------------------------------------------------------------- /AngularHeroes/src/app/message.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | 3 | @Injectable({ providedIn: 'root' }) 4 | export class MessageService { 5 | messages: string[] = []; 6 | 7 | add(message: string) { 8 | this.messages.push(message); 9 | } 10 | 11 | clear() { 12 | this.messages = []; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /AngularHeroes/src/app/messages/messages.component.css: -------------------------------------------------------------------------------- 1 | /* MessagesComponent's private CSS styles */ 2 | h2 { 3 | color: #A80000; 4 | font-family: Arial, Helvetica, sans-serif; 5 | font-weight: lighter; 6 | } 7 | 8 | .clear { 9 | color: #333; 10 | background-color: #eee; 11 | margin-bottom: 12px; 12 | padding: 1rem; 13 | border-radius: 4px; 14 | font-size: 1rem; 15 | } 16 | .clear:hover { 17 | color: #fff; 18 | background-color: #42545C; 19 | } 20 | -------------------------------------------------------------------------------- /AngularHeroes/src/app/messages/messages.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |

Messages

4 | 7 |
{{message}}
8 | 9 |
10 | -------------------------------------------------------------------------------- /AngularHeroes/src/app/messages/messages.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { MessageService } from '../message.service'; 3 | 4 | @Component({ 5 | selector: 'app-messages', 6 | templateUrl: './messages.component.html', 7 | styleUrls: ['./messages.component.css'], 8 | standalone: false 9 | }) 10 | export class MessagesComponent implements OnInit { 11 | 12 | constructor(public messageService: MessageService) {} 13 | 14 | ngOnInit() { 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /AngularHeroes/src/conf/siteconfig.js: -------------------------------------------------------------------------------- 1 | const SITE_CONFIG = { 2 | apiBaseuri: "http://localhost:5000/" 3 | } 4 | -------------------------------------------------------------------------------- /AngularHeroes/src/conf/siteconfigProd.js: -------------------------------------------------------------------------------- 1 | const SITE_CONFIG = { 2 | apiBaseuri: "https://heroes.fonlow.net/webapi/" 3 | } 4 | -------------------------------------------------------------------------------- /AngularHeroes/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | declare const SITE_CONFIG: { 2 | apiBaseuri?: string; 3 | } 4 | 5 | interface SiteConfigConstantsType { 6 | apiBaseuri?: string; 7 | } 8 | 9 | export const environment = { 10 | production: true 11 | }; 12 | 13 | export const SiteConfigConstants: SiteConfigConstantsType = { 14 | 15 | ...(typeof SITE_CONFIG === 'undefined' ? {} : SITE_CONFIG), 16 | } 17 | -------------------------------------------------------------------------------- /AngularHeroes/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | declare const SITE_CONFIG: { 6 | apiBaseuri?: string; 7 | } 8 | 9 | interface SiteConfigConstantsType { 10 | apiBaseuri?: string; 11 | } 12 | 13 | export const environment = { 14 | production: false 15 | }; 16 | 17 | export const SiteConfigConstants: SiteConfigConstantsType = { 18 | 19 | ...(typeof SITE_CONFIG === 'undefined' ? {} : SITE_CONFIG), 20 | } 21 | -------------------------------------------------------------------------------- /AngularHeroes/src/favicon.ico: -------------------------------------------------------------------------------- 1 | �PNG 2 |  3 | IHDR?�~� pHYs  ��~�fIDATH��WKLQ���̔�uG�� e�n�. 6qcb�l?���D`�F#� Ku�F 1Qc� 4 | ��!���� ��C�P�|B?$���ܱ3����I&}��}�̽s�[*�ɀU�A��K��yx�gY�Ajq��3L Š���˫�OD�4��3Ϗ:X�3��o�P J�ğo#IH�a����,{>1/�2$�R AR]�)w��?�sZw^��q�Y�m_��e���r[8�^� 5 | �&p��-���A}c��- ������!����2_) E�)㊪j���v�m��ZOi� g�nW�{�n.|�e2�a&�0aŸ����be�̀��C�fˤE%-{�ֺ��׮C��N��jXi�~c�C,t��T�����r�{� �L)s��V��6%�(�#ᤙ!�]��H�ҐH$R���^R�A�61(?Y舚�>���(Z����Qm�L2�K�ZIc�� 6 | ���̧�C��2!⅄�(����"�Go��>�q��=��$%�z`ѯ��T�&����PHh�Z!=���z��O��������,*VVV�1�f*CJ�]EE��K�k��d�#5���`2yT!�}7���߈~�,���zs�����y�T��V������D��C2�G��@%̑72Y�޾{oJ�"@��^h�~ ��fĬ�!a�D��6���Ha|�3��� [>�����]7U2п���]�ė 7 | ��PU� �.Wejq�in�g��+p<ߺQH����總j[������.��� Q���p _�K�� 1(��+��bB8�\ra 8 | �́�v.l���(���ǽ�w���L��w�8�C��IEND�B`� -------------------------------------------------------------------------------- /AngularHeroes/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Tour of Heroes 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /AngularHeroes/src/locales/messages.es.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Details 6 | Details 7 | 8 | 9 | 10 | 11 | Tour of Heroes 12 | Tour of Heroes 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /AngularHeroes/src/locales/messages.ja.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Details 6 | Details 7 | 8 | 9 | 10 | 11 | Tour of Heroes 12 | Tour of Heroes 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /AngularHeroes/src/locales/messages.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | src/app/hero-detail/hero-detail.component.html:2,3 7 | 8 | 9 | Details 10 | 11 | 12 | 13 | 14 | src/app/app.component.ts:11 15 | 16 | 17 | Tour of Heroes 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /AngularHeroes/src/locales/messages.zh-hans.xlf: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | Details 8 | 9 | 细节 10 | 11 | 12 | 13 | 14 | 15 | Tour of Heroes 16 | 游览英雄 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /AngularHeroes/src/locales/messages.zh-hant.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Details 6 | Details 7 | 8 | 9 | 10 | 11 | Tour of Heroes 12 | Tour of Heroes 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /AngularHeroes/src/main.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | import { enableProdMode } from '@angular/core'; 4 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 5 | 6 | import { AppModule } from './app/app.module'; 7 | import { environment } from './environments/environment'; 8 | 9 | if (environment.production) { 10 | enableProdMode(); 11 | } 12 | 13 | platformBrowserDynamic().bootstrapModule(AppModule) 14 | .catch(err => console.error(err)); 15 | -------------------------------------------------------------------------------- /AngularHeroes/startDev.ps1: -------------------------------------------------------------------------------- 1 | #Run prod build with dotnet hosting 2 | cd $PSScriptRoot 3 | dotnet-serve -d ../ngdist/dev/browser -p 5200 4 | -------------------------------------------------------------------------------- /AngularHeroes/startProd.ps1: -------------------------------------------------------------------------------- 1 | #Run prod build with dotnet hosting 2 | cd $PSScriptRoot 3 | dotnet-serve -d ../ngdist/prod/browser/ -p 5200 4 | -------------------------------------------------------------------------------- /AngularHeroes/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/app", 6 | "types": [ 7 | "@angular/localize" 8 | ] 9 | }, 10 | "files": [ 11 | "src/main.ts", 12 | ], 13 | "include": [ 14 | "src/**/*.d.ts" 15 | ], 16 | "exclude": [ 17 | "src/test.ts", 18 | "src/**/*.spec.ts", 19 | "src/**/*-specs.ts", 20 | "src/**/*.avoid.ts", 21 | "src/**/*.0.ts", 22 | "src/**/*.1.ts", 23 | "src/**/*.1b.ts", 24 | "src/**/*.2.ts", 25 | "src/**/*.3.ts", 26 | "src/**/*.4.ts", 27 | "src/**/*.5.ts", 28 | "src/**/*.6.ts", 29 | "src/**/*.7.ts", 30 | "src/**/testing" 31 | ] 32 | } 33 | -------------------------------------------------------------------------------- /AngularHeroes/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "compileOnSave": false, 4 | "compilerOptions": { 5 | "baseUrl": "./", 6 | "outDir": "./dist/out-tsc", 7 | "forceConsistentCasingInFileNames": true, 8 | "esModuleInterop": true, 9 | "strict": true, 10 | "noImplicitOverride": true, 11 | "noPropertyAccessFromIndexSignature": true, 12 | "noImplicitReturns": true, 13 | "noFallthroughCasesInSwitch": true, 14 | "sourceMap": true, 15 | "declaration": false, 16 | "experimentalDecorators": true, 17 | "moduleResolution": "node", 18 | "importHelpers": true, 19 | "target": "ES2022", 20 | "module": "ES2022", 21 | "lib": [ 22 | "ES2022", 23 | "dom" 24 | ] 25 | }, 26 | "angularCompilerOptions": { 27 | "enableI18nLegacyMessageIdFormat": false, 28 | "strictInjectionParameters": true, 29 | "strictInputAccessModifiers": true, 30 | "strictTemplates": true 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /AngularHeroes/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/spec", 6 | "types": [ 7 | "jasmine", 8 | "@angular/localize" 9 | ] 10 | }, 11 | "files": [ 12 | ], 13 | "include": [ 14 | "src/**/*.spec.ts", 15 | "src/**/*.d.ts" 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /AureliaHeroes/.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | end_of_line = lf 9 | insert_final_newline = true 10 | # 2 space indentation 11 | indent_style = space 12 | indent_size = 2 13 | -------------------------------------------------------------------------------- /AureliaHeroes/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "parser": "@typescript-eslint/parser", 4 | "plugins": [ 5 | "@typescript-eslint" 6 | ], 7 | "extends": [ 8 | "eslint:recommended", 9 | "plugin:@typescript-eslint/eslint-recommended", 10 | "plugin:@typescript-eslint/recommended" 11 | ], 12 | "parserOptions": { 13 | "ecmaVersion": 2019, 14 | "sourceType": "module", 15 | "project": "./tsconfig.json", 16 | "tsconfigRootDir": "." 17 | }, 18 | "rules": { 19 | "no-unused-vars": 0, 20 | "@typescript-eslint/no-unused-vars": 0, 21 | "no-prototype-builtins": 0, 22 | "no-console": 0, 23 | "getter-return": 0 24 | }, 25 | "env": { 26 | "es6": true, 27 | "browser": true, 28 | "node": true, 29 | "jest": true 30 | } 31 | } -------------------------------------------------------------------------------- /AureliaHeroes/.npmrc: -------------------------------------------------------------------------------- 1 | # for pnpm, use flat node_modules 2 | shamefully-hoist=true 3 | -------------------------------------------------------------------------------- /AureliaHeroes/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "AureliaEffect.aurelia", 4 | "msjsdiag.debugger-for-chrome", 5 | "steoates.autoimport", 6 | "EditorConfig.EditorConfig", 7 | "christian-kohler.path-intellisense", 8 | "behzad88.Aurelia" 9 | ] 10 | } -------------------------------------------------------------------------------- /AureliaHeroes/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Chrome", 6 | "type": "chrome", 7 | "request": "launch", 8 | "url": "http://localhost:8080", 9 | "webRoot": "${workspaceRoot}/src", 10 | "userDataDir": "${workspaceRoot}/.chrome", 11 | "sourceMapPathOverrides": { 12 | "webpack://${workspaceFolderBasename}/./src/*": "${webRoot}/*" 13 | } 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /AureliaHeroes/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.tsdk": "node_modules/typescript/lib", 3 | "html.suggest.angular1": false, 4 | "html.suggest.ionic": false 5 | } -------------------------------------------------------------------------------- /AureliaHeroes/aurelia_project/aurelia.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "aurelia-heroes", 3 | "type": "project:application", 4 | "paths": { 5 | "root": "src", 6 | "resources": "resources", 7 | "elements": "resources/elements", 8 | "attributes": "resources/attributes", 9 | "valueConverters": "resources/value-converters", 10 | "bindingBehaviors": "resources/binding-behaviors" 11 | }, 12 | "transpiler": { 13 | "id": "typescript", 14 | "fileExtension": ".ts" 15 | }, 16 | "build": { 17 | "options": { 18 | "server": "dev", 19 | "extractCss": "prod", 20 | "coverage": false 21 | } 22 | }, 23 | "platform": { 24 | "hmr": false, 25 | "open": false, 26 | "port": 8080, 27 | "host": "localhost", 28 | "output": "dist" 29 | }, 30 | "cssProcessor": { 31 | "id": "none", 32 | "displayName": "None", 33 | "fileExtension": ".css" 34 | } 35 | } -------------------------------------------------------------------------------- /AureliaHeroes/aurelia_project/generators/attribute.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "attribute", 3 | "description": "Creates a custom attribute class and places it in the project resources." 4 | } -------------------------------------------------------------------------------- /AureliaHeroes/aurelia_project/generators/binding-behavior.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "binding-behavior", 3 | "description": "Creates a binding behavior class and places it in the project resources." 4 | } -------------------------------------------------------------------------------- /AureliaHeroes/aurelia_project/generators/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "component", 3 | "description": "Creates a custom component class and template (view model and view), placing them in the project source folder (or optionally in sub folders)." 4 | } -------------------------------------------------------------------------------- /AureliaHeroes/aurelia_project/generators/element.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "element", 3 | "description": "Creates a custom element class and template, placing them in the project resources." 4 | } -------------------------------------------------------------------------------- /AureliaHeroes/aurelia_project/generators/generator.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "generator", 3 | "description": "Creates a generator class and places it in the project generators folder." 4 | } -------------------------------------------------------------------------------- /AureliaHeroes/aurelia_project/generators/task.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "task", 3 | "description": "Creates a task and places it in the project tasks folder." 4 | } -------------------------------------------------------------------------------- /AureliaHeroes/aurelia_project/generators/value-converter.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "value-converter", 3 | "description": "Creates a value converter class and places it in the project resources." 4 | } -------------------------------------------------------------------------------- /AureliaHeroes/aurelia_project/tasks/build.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "build", 3 | "description": "Builds and processes all application assets. It is an alias of the `npm run build:dev`, you may use either of those; see README for more details.", 4 | "flags": [ 5 | { 6 | "name": "analyze", 7 | "description": "Enable Webpack Bundle Analyzer. Typically paired with --env prod", 8 | "type": "boolean" 9 | }, 10 | { 11 | "name": "env", 12 | "description": "Sets the build environment.", 13 | "type": "string" 14 | }, 15 | { 16 | "name": "watch", 17 | "description": "Watches source files for changes and refreshes the bundles automatically.", 18 | "type": "boolean" 19 | } 20 | ] 21 | } -------------------------------------------------------------------------------- /AureliaHeroes/aurelia_project/tasks/build.ts: -------------------------------------------------------------------------------- 1 | import { NPM } from 'aurelia-cli'; 2 | 3 | export default function() { 4 | console.log('`au build` is an alias of the `npm run build:dev`, you may use either of those; see README for more details.'); 5 | const args = process.argv.slice(3); 6 | return (new NPM()).run('run', ['build:dev', '--', ... cleanArgs(args)]); 7 | } 8 | 9 | // Cleanup --env prod to --env production 10 | // for backwards compatibility 11 | function cleanArgs(args) { 12 | const cleaned = []; 13 | for (let i = 0, ii = args.length; i < ii; i++) { 14 | if (args[i] === '--env' && i < ii - 1) { 15 | const env = args[++i].toLowerCase(); 16 | if (env.startsWith('prod')) { 17 | cleaned.push('--env production'); 18 | } 19 | } else { 20 | cleaned.push(args[i]); 21 | } 22 | } 23 | return cleaned; 24 | } 25 | -------------------------------------------------------------------------------- /AureliaHeroes/aurelia_project/tasks/jest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jest", 3 | "description": "Runs Jest and reports the results.", 4 | "flags": [ 5 | { 6 | "name": "watch", 7 | "description": "Watches test files for changes and re-runs the tests automatically.", 8 | "type": "boolean" 9 | } 10 | ] 11 | } -------------------------------------------------------------------------------- /AureliaHeroes/aurelia_project/tasks/jest.ts: -------------------------------------------------------------------------------- 1 | export {default} from './test'; 2 | -------------------------------------------------------------------------------- /AureliaHeroes/aurelia_project/tasks/test.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test", 3 | "description": "Runs Jest and reports the results.", 4 | "flags": [ 5 | { 6 | "name": "watch", 7 | "description": "Watches test files for changes and re-runs the tests automatically.", 8 | "type": "boolean" 9 | } 10 | ] 11 | } -------------------------------------------------------------------------------- /AureliaHeroes/aurelia_project/tasks/test.ts: -------------------------------------------------------------------------------- 1 | import { runCLI } from '@jest/core'; 2 | import * as path from 'path'; 3 | import * as packageJson from '../../package.json'; 4 | 5 | import { CLIOptions } from 'aurelia-cli'; 6 | 7 | export default (cb) => { 8 | let options = packageJson.jest; 9 | 10 | if (CLIOptions.hasFlag('watch')) { 11 | Object.assign(options, { watchAll: true}); 12 | } 13 | 14 | runCLI(options, [path.resolve(__dirname, '../../')]).then(({ results }) => { 15 | if (results.numFailedTests || results.numFailedTestSuites) { 16 | cb('Tests Failed'); 17 | } else { 18 | cb(); 19 | } 20 | }); 21 | }; 22 | -------------------------------------------------------------------------------- /AureliaHeroes/config/environment.json: -------------------------------------------------------------------------------- 1 | { 2 | "debug": true, 3 | "testing": true 4 | } -------------------------------------------------------------------------------- /AureliaHeroes/config/environment.production.json: -------------------------------------------------------------------------------- 1 | { 2 | "debug": false, 3 | "testing": false 4 | } -------------------------------------------------------------------------------- /AureliaHeroes/index.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Aurelia Navigation Skeleton 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /AureliaHeroes/src/app.html: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /AureliaHeroes/src/app.ts: -------------------------------------------------------------------------------- 1 | import { Router, RouterConfiguration } from 'aurelia-router'; 2 | import { PLATFORM } from 'aurelia-pal'; 3 | import { Container } from 'aurelia-dependency-injection'; 4 | import {inject} from 'aurelia-framework'; 5 | 6 | @inject(Container) 7 | export class App { 8 | 9 | constructor(){ 10 | } 11 | 12 | configureRouter(config: RouterConfiguration, router: Router) { 13 | config.title = 'Heroes'; 14 | config.options.pushState = true; 15 | //config.options.root = '/'; 16 | config.map([ 17 | //{ route: '', redirect: '/dashboard' }, 18 | { route: ['', 'dashboard'], moduleId: PLATFORM.moduleName('components/dashboard'), title: 'Dashboard', name: 'dashboard' }, 19 | { route: 'heroes', moduleId: PLATFORM.moduleName('components/heroes'), title: 'Heroes', name: 'heroes' }, 20 | { route: 'detail/:id', moduleId: PLATFORM.moduleName('components/hero-detail'), name: 'detail' }, 21 | ]); 22 | } 23 | 24 | public message = 'Aurelia Heroes!'; 25 | } 26 | -------------------------------------------------------------------------------- /AureliaHeroes/src/components/dashboard.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /AureliaHeroes/src/components/dashboard.ts: -------------------------------------------------------------------------------- 1 | import { HttpClient } from 'aurelia-fetch-client'; 2 | import {DemoWebApi_Controllers_Client} from 'clientapi/WebApiCoreAureliaClientAuto'; 3 | 4 | import {inject} from 'aurelia-framework'; 5 | 6 | @inject(DemoWebApi_Controllers_Client.Heroes) 7 | export class DashboardComponent { 8 | heroes: DemoWebApi_Controllers_Client.Hero[] = []; 9 | 10 | constructor(private heroesSerrvice: DemoWebApi_Controllers_Client.Heroes) { 11 | } 12 | 13 | created() { 14 | this.heroesSerrvice.getHeroes().then( 15 | heroes => { 16 | this.heroes = heroes.slice(1, 5); 17 | } 18 | ).catch(error => console.error(error)); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /AureliaHeroes/src/components/hero-detail.css: -------------------------------------------------------------------------------- 1 | /* HeroDetailComponent's private CSS styles */ 2 | label { 3 | color: #435960; 4 | font-weight: bold; 5 | } 6 | input { 7 | font-size: 1em; 8 | padding: .5rem; 9 | } 10 | button { 11 | margin-top: 20px; 12 | margin-right: .5rem; 13 | background-color: #eee; 14 | padding: 1rem; 15 | border-radius: 4px; 16 | font-size: 1rem; 17 | } 18 | button:hover { 19 | background-color: #cfd8dc; 20 | } 21 | button:disabled { 22 | background-color: #eee; 23 | color: #ccc; 24 | cursor: auto; 25 | } 26 | -------------------------------------------------------------------------------- /AureliaHeroes/src/components/hero-detail.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /AureliaHeroes/src/components/heroes.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /AureliaHeroes/src/main.ts: -------------------------------------------------------------------------------- 1 | import {Aurelia} from 'aurelia-framework'; 2 | import environment from '../config/environment.json'; 3 | import {PLATFORM} from 'aurelia-pal'; 4 | import { HttpClient } from 'aurelia-fetch-client'; 5 | import {DemoWebApi_Controllers_Client} from 'clientapi/WebApiCoreAureliaClientAuto'; 6 | 7 | export function configure(aurelia: Aurelia): void { 8 | aurelia.use 9 | .standardConfiguration() 10 | .feature(PLATFORM.moduleName('resources/index')); 11 | 12 | aurelia.use.developmentLogging(environment.debug ? 'debug' : 'warn'); 13 | 14 | if (environment.testing) { 15 | aurelia.use.plugin(PLATFORM.moduleName('aurelia-testing')); 16 | } 17 | 18 | const c= new HttpClient(); 19 | c.baseUrl='http://localhost:5000/'; 20 | aurelia.container.registerInstance(DemoWebApi_Controllers_Client.Heroes, new DemoWebApi_Controllers_Client.Heroes(c)); 21 | 22 | aurelia.start().then(() => aurelia.setRoot(PLATFORM.moduleName('app'))); 23 | } 24 | -------------------------------------------------------------------------------- /AureliaHeroes/src/resources/index.ts: -------------------------------------------------------------------------------- 1 | import {FrameworkConfiguration} from 'aurelia-framework'; 2 | 3 | export function configure(config: FrameworkConfiguration): void { 4 | //config.globalResources([]); 5 | } 6 | -------------------------------------------------------------------------------- /AureliaHeroes/startApp.bat: -------------------------------------------------------------------------------- 1 | ::Run `npm run build` for prod build first 2 | ::Launch local Web API 3 | ::Then use in Web browser 4 | 5 | dotnet-serve -d dist\ -p 5300 6 | -------------------------------------------------------------------------------- /AureliaHeroes/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/AureliaHeroes/static/favicon.ico -------------------------------------------------------------------------------- /AureliaHeroes/test/jest-pretest.ts: -------------------------------------------------------------------------------- 1 | import 'aurelia-polyfills'; 2 | import {Options} from 'aurelia-loader-nodejs'; 3 | import {globalize} from 'aurelia-pal-nodejs'; 4 | import * as path from 'path'; 5 | Options.relativeToDir = path.join(__dirname, 'unit'); 6 | globalize(); 7 | -------------------------------------------------------------------------------- /AureliaHeroes/test/unit/app.spec.ts: -------------------------------------------------------------------------------- 1 | import {bootstrap} from 'aurelia-bootstrapper'; 2 | import {StageComponent} from 'aurelia-testing'; 3 | import {PLATFORM} from 'aurelia-pal'; 4 | 5 | describe('Stage App Component', () => { 6 | let component; 7 | 8 | beforeEach(() => { 9 | component = StageComponent 10 | .withResources(PLATFORM.moduleName('app')) 11 | .inView(''); 12 | }); 13 | 14 | afterEach(() => component.dispose()); 15 | 16 | it('should render message', done => { 17 | component.create(bootstrap).then(() => { 18 | const view = component.element; 19 | expect(view.textContent.trim()).toBe('Hello World!'); 20 | done(); 21 | }).catch(e => { 22 | fail(e); 23 | done(); 24 | }); 25 | }); 26 | }); 27 | -------------------------------------------------------------------------------- /AureliaHeroes/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "esModuleInterop": true, 5 | "module": "esnext", 6 | "typeRoots": [ 7 | "./node_modules/@types" 8 | ], 9 | "removeComments": true, 10 | "emitDecoratorMetadata": true, 11 | "experimentalDecorators": true, 12 | "sourceMap": true, 13 | "target": "es2022", 14 | "lib": [ 15 | "es2022", 16 | "dom" 17 | ], 18 | "moduleResolution": "node", 19 | "baseUrl": "src", 20 | "resolveJsonModule": true, 21 | "importHelpers": true, 22 | "allowJs": true 23 | }, 24 | "include": [ 25 | "src", 26 | "test" 27 | ], 28 | "atom": { 29 | "rewriteTsconfig": false 30 | } 31 | } -------------------------------------------------------------------------------- /BlazorHeroesWA/BlazorHeroesWA.Client/BlazorHeroesWA.Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | true 8 | Default 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /BlazorHeroesWA/BlazorHeroesWA.Client/Pages/Counter.razor: -------------------------------------------------------------------------------- 1 | @page "/counter" 2 | @rendermode InteractiveWebAssembly 3 | 4 | Counter 5 | 6 |

Counter

7 | 8 |

Current count: @currentCount

9 | 10 | 11 | 12 | @code { 13 | private int currentCount = 0; 14 | 15 | private void IncrementCount() 16 | { 17 | currentCount++; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /BlazorHeroesWA/BlazorHeroesWA.Client/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components.WebAssembly.Hosting; 2 | 3 | var builder = WebAssemblyHostBuilder.CreateDefault(args); 4 | 5 | await builder.Build().RunAsync(); 6 | -------------------------------------------------------------------------------- /BlazorHeroesWA/BlazorHeroesWA.Client/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using static Microsoft.AspNetCore.Components.Web.RenderMode 7 | @using Microsoft.AspNetCore.Components.Web.Virtualization 8 | @using Microsoft.JSInterop 9 | @using BlazorHeroesWA.Client 10 | -------------------------------------------------------------------------------- /BlazorHeroesWA/BlazorHeroesWA.Client/wwwroot/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /BlazorHeroesWA/BlazorHeroesWA.Client/wwwroot/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /BlazorHeroesWA/BlazorHeroesWA/BlazorHeroesWA.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /BlazorHeroesWA/BlazorHeroesWA/Components/App.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /BlazorHeroesWA/BlazorHeroesWA/Components/Layout/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 |
4 | 7 | 8 |
9 |
10 | About 11 |
12 | 13 |
14 | @Body 15 |
16 |
17 |
18 | 19 |
20 | An unhandled error has occurred. 21 | Reload 22 | 🗙 23 |
24 | -------------------------------------------------------------------------------- /BlazorHeroesWA/BlazorHeroesWA/Components/Pages/Home.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 | Home 4 | 5 |

Hello, world!

6 | 7 | Welcome to your new app. 8 | -------------------------------------------------------------------------------- /BlazorHeroesWA/BlazorHeroesWA/Components/Routes.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /BlazorHeroesWA/BlazorHeroesWA/Components/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using static Microsoft.AspNetCore.Components.Web.RenderMode 7 | @using Microsoft.AspNetCore.Components.Web.Virtualization 8 | @using Microsoft.JSInterop 9 | @using BlazorHeroesWA 10 | @using BlazorHeroesWA.Client 11 | @using BlazorHeroesWA.Components 12 | -------------------------------------------------------------------------------- /BlazorHeroesWA/BlazorHeroesWA/Program.cs: -------------------------------------------------------------------------------- 1 | using BlazorHeroesWA.Client.Pages; 2 | using BlazorHeroesWA.Components; 3 | 4 | var builder = WebApplication.CreateBuilder(args); 5 | 6 | // Add services to the container. 7 | builder.Services.AddRazorComponents() 8 | .AddInteractiveWebAssemblyComponents(); 9 | 10 | var app = builder.Build(); 11 | 12 | // Configure the HTTP request pipeline. 13 | if (app.Environment.IsDevelopment()) 14 | { 15 | app.UseWebAssemblyDebugging(); 16 | } 17 | else 18 | { 19 | app.UseExceptionHandler("/Error", createScopeForErrors: true); 20 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 21 | app.UseHsts(); 22 | } 23 | 24 | app.UseHttpsRedirection(); 25 | 26 | app.UseStaticFiles(); 27 | app.UseAntiforgery(); 28 | 29 | app.MapRazorComponents() 30 | .AddInteractiveWebAssemblyRenderMode() 31 | .AddAdditionalAssemblies(typeof(BlazorHeroesWA.Client._Imports).Assembly); 32 | 33 | app.Run(); 34 | -------------------------------------------------------------------------------- /BlazorHeroesWA/BlazorHeroesWA/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /BlazorHeroesWA/BlazorHeroesWA/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /BlazorHeroesWA/BlazorHeroesWA/wwwroot/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/BlazorHeroesWA/BlazorHeroesWA/wwwroot/favicon.png -------------------------------------------------------------------------------- /BlazorHeroesWAStandalone/App.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | Not found 8 | 9 |

Sorry, there's nothing at this address.

10 |
11 |
12 |
13 | -------------------------------------------------------------------------------- /BlazorHeroesWAStandalone/Layout/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 |
3 | 6 | 7 |
8 |
9 | About 10 |
11 | 12 |
13 | @Body 14 |
15 |
16 |
17 | -------------------------------------------------------------------------------- /BlazorHeroesWAStandalone/Pages/Counter.razor: -------------------------------------------------------------------------------- 1 | @page "/counter" 2 | 3 | Counter 4 | 5 |

Counter

6 | 7 |

Current count: @currentCount

8 | 9 | 10 | 11 | @code { 12 | private int currentCount = 0; 13 | 14 | private void IncrementCount() 15 | { 16 | currentCount++; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /BlazorHeroesWAStandalone/Pages/Dashboard.razor: -------------------------------------------------------------------------------- 1 | @page "/dashboard" 2 | 3 | @inject DemoWebApi.Controllers.Client.Heroes heroesApi //use typed HttpClient 4 | 5 | Dashboard 6 |

Top Heroes

7 | 8 | @if (heroes == null) 9 | { 10 |

Loading Heroes...

11 | } 12 | else 13 | { 14 |
15 | @foreach (var hero in heroes.Take(4)) 16 | { 17 | string href = $"/detail/{hero.Id}"; 18 | @hero.Name 19 | } 20 | 21 |
22 | } 23 | 24 | @code { 25 | private DemoWebApi.Controllers.Client.Hero[]? heroes; 26 | DemoWebApi.Controllers.Client.Heroes? heroesClient; 27 | 28 | protected override async Task OnInitializedAsync() 29 | { 30 | heroes = await heroesApi.GetAsyncHeroesAsync(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /BlazorHeroesWAStandalone/Pages/HeroDetail.razor.css: -------------------------------------------------------------------------------- 1 | /* HeroDetailComponent's private CSS styles */ 2 | label { 3 | color: #435960; 4 | font-weight: bold; 5 | } 6 | 7 | input { 8 | font-size: 1em; 9 | padding: .5rem; 10 | } 11 | 12 | button { 13 | margin-top: 20px; 14 | margin-right: .5rem; 15 | background-color: #eee; 16 | padding: 1rem; 17 | border-radius: 4px; 18 | font-size: 1rem; 19 | } 20 | 21 | button:hover { 22 | background-color: #cfd8dc; 23 | } 24 | 25 | button:disabled { 26 | background-color: #eee; 27 | color: #ccc; 28 | cursor: auto; 29 | } 30 | -------------------------------------------------------------------------------- /BlazorHeroesWAStandalone/Pages/Home.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 | Home 4 | 5 |

Hello, world!

6 | 7 | Welcome to your new app. 8 | -------------------------------------------------------------------------------- /BlazorHeroesWAStandalone/README.md: -------------------------------------------------------------------------------- 1 | Blazor Standalone (PWA). 2 | 3 | Based on the scaffolding codes, the app talks to locally hosted Core3WebApi which contains Heroes API. 4 | 5 | This app by default talking to a locally hosted Core3WebApi which may be launched through StartCoreWebApi.ps1. 6 | 7 | References: 8 | 9 | * [Tour of Heroes: Blazor WebAssembly Standalone App](https://www.codeproject.com/Articles/5383736/Tour-of-Heroes-Blazor-WebAssembly-Standalone-App) -------------------------------------------------------------------------------- /BlazorHeroesWAStandalone/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using Microsoft.AspNetCore.Components.Web.Virtualization 7 | @using Microsoft.AspNetCore.Components.WebAssembly.Http 8 | @using Microsoft.JSInterop 9 | @using BlazorHeroesWAStandalone 10 | @using BlazorHeroesWAStandalone.Layout 11 | -------------------------------------------------------------------------------- /BlazorHeroesWAStandalone/wwwroot/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/BlazorHeroesWAStandalone/wwwroot/favicon.png -------------------------------------------------------------------------------- /BlazorHeroesWAStandalone/wwwroot/icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/BlazorHeroesWAStandalone/wwwroot/icon-192.png -------------------------------------------------------------------------------- /BlazorHeroesWAStandalone/wwwroot/icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/BlazorHeroesWAStandalone/wwwroot/icon-512.png -------------------------------------------------------------------------------- /BlazorHeroesWAStandalone/wwwroot/manifest.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "name": "BlazorHeroesWAStandalone", 3 | "short_name": "BlazorHeroesWAStandalone", 4 | "id": "./", 5 | "start_url": "./", 6 | "display": "standalone", 7 | "background_color": "#ffffff", 8 | "theme_color": "#03173d", 9 | "prefer_related_applications": false, 10 | "icons": [ 11 | { 12 | "src": "icon-512.png", 13 | "type": "image/png", 14 | "sizes": "512x512" 15 | }, 16 | { 17 | "src": "icon-192.png", 18 | "type": "image/png", 19 | "sizes": "192x192" 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /BlazorHeroesWAStandalone/wwwroot/sample-data/weather.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "date": "2022-01-06", 4 | "temperatureC": 1, 5 | "summary": "Freezing" 6 | }, 7 | { 8 | "date": "2022-01-07", 9 | "temperatureC": 14, 10 | "summary": "Bracing" 11 | }, 12 | { 13 | "date": "2022-01-08", 14 | "temperatureC": -13, 15 | "summary": "Freezing" 16 | }, 17 | { 18 | "date": "2022-01-09", 19 | "temperatureC": -16, 20 | "summary": "Balmy" 21 | }, 22 | { 23 | "date": "2022-01-10", 24 | "temperatureC": -2, 25 | "summary": "Chilly" 26 | } 27 | ] 28 | -------------------------------------------------------------------------------- /BlazorHeroesWAStandalone/wwwroot/service-worker.js: -------------------------------------------------------------------------------- 1 | // In development, always fetch from the network and do not enable offline support. 2 | // This is because caching would make development more difficult (changes would not 3 | // be reflected on the first load after each change). 4 | self.addEventListener('fetch', () => { }); 5 | -------------------------------------------------------------------------------- /BlazorHeroesWeb/BlazorHeroesWeb.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /BlazorHeroesWeb/Components/App.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /BlazorHeroesWeb/Components/Layout/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 |
4 | 7 | 8 |
9 |
10 | About 11 |
12 | 13 |
14 | @Body 15 |
16 |
17 |
18 | 19 |
20 | An unhandled error has occurred. 21 | Reload 22 | 🗙 23 |
24 | -------------------------------------------------------------------------------- /BlazorHeroesWeb/Components/Pages/Counter.razor: -------------------------------------------------------------------------------- 1 | @page "/counter" 2 | @rendermode InteractiveServer 3 | 4 | Counter 5 | 6 |

Counter

7 | 8 |

Current count: @currentCount

9 | 10 | 11 | 12 | @code { 13 | private int currentCount = 0; 14 | 15 | private void IncrementCount() 16 | { 17 | currentCount++; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /BlazorHeroesWeb/Components/Pages/Home.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 | Home 4 | 5 |

Hello, world!

6 | 7 | Welcome to your new app. 8 | -------------------------------------------------------------------------------- /BlazorHeroesWeb/Components/Routes.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /BlazorHeroesWeb/Components/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using static Microsoft.AspNetCore.Components.Web.RenderMode 7 | @using Microsoft.AspNetCore.Components.Web.Virtualization 8 | @using Microsoft.JSInterop 9 | @using BlazorHeroesWeb 10 | @using BlazorHeroesWeb.Components 11 | -------------------------------------------------------------------------------- /BlazorHeroesWeb/Program.cs: -------------------------------------------------------------------------------- 1 | using BlazorHeroesWeb.Components; 2 | 3 | var builder = WebApplication.CreateBuilder(args); 4 | 5 | // Add services to the container. 6 | builder.Services.AddRazorComponents() 7 | .AddInteractiveServerComponents(); 8 | 9 | var app = builder.Build(); 10 | 11 | // Configure the HTTP request pipeline. 12 | if (!app.Environment.IsDevelopment()) 13 | { 14 | app.UseExceptionHandler("/Error", createScopeForErrors: true); 15 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 16 | app.UseHsts(); 17 | } 18 | 19 | app.UseHttpsRedirection(); 20 | 21 | app.UseStaticFiles(); 22 | app.UseAntiforgery(); 23 | 24 | app.MapRazorComponents() 25 | .AddInteractiveServerRenderMode(); 26 | 27 | app.Run(); 28 | -------------------------------------------------------------------------------- /BlazorHeroesWeb/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /BlazorHeroesWeb/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /BlazorHeroesWeb/wwwroot/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/BlazorHeroesWeb/wwwroot/favicon.png -------------------------------------------------------------------------------- /Core3Mvc/CodeGen.json: -------------------------------------------------------------------------------- 1 | { 2 | "ApiSelections": { 3 | "ExcludedControllerNames": [ 4 | "DemoWebApi.Controllers.Home", 5 | "DemoWebApi.Controllers.FileUpload" 6 | ], 7 | 8 | "DataModelAssemblyNames": [ 9 | "DemoWebApi.DemoDataCore", 10 | "DemoCoreWebControllers", 11 | "Core3WebApi" 12 | ], 13 | "CherryPickingMethods": 3 14 | }, 15 | 16 | "ClientApiOutputs": { 17 | "ClientLibraryProjectFolderName": "../../CoreWebApi.ClientApi", 18 | "GenerateBothAsyncAndSync": true, 19 | "StringAsString": true, 20 | "CamelCase": true, 21 | "UseEnsureSuccessStatusCodeEx": true, 22 | "DataAnnotationsEnabled": true, 23 | "DataAnnotationsToComments": true, 24 | "HandleHttpRequestHeaders": true, 25 | "UseSystemTextJson": true, 26 | 27 | "Plugins": [ 28 | 29 | ] 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Core3Mvc/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Mvc; 7 | using Microsoft.Extensions.Logging; 8 | using Core3Mvc.Models; 9 | 10 | namespace Core3Mvc.Controllers 11 | { 12 | [ApiExplorerSettings(IgnoreApi = true)] 13 | public class HomeController : Controller 14 | { 15 | private readonly ILogger _logger; 16 | 17 | public HomeController(ILogger logger) 18 | { 19 | _logger = logger; 20 | } 21 | 22 | public IActionResult Index() 23 | { 24 | return View(); 25 | } 26 | 27 | public IActionResult Privacy() 28 | { 29 | return View(); 30 | } 31 | 32 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 33 | public IActionResult Error() 34 | { 35 | return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Core3Mvc/Core3Mvc.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | True 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Core3Mvc/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Core3Mvc.Models 4 | { 5 | public class ErrorViewModel 6 | { 7 | public string RequestId { get; set; } 8 | 9 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Core3Mvc/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace Core3Mvc 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Core3Mvc/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:52910", 7 | "sslPort": 44317 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "Core3Mvc": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Core3Mvc/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 |
6 |

Welcome

7 |

Learn about building Web apps with ASP.NET Core.

8 |
9 | -------------------------------------------------------------------------------- /Core3Mvc/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.

7 | -------------------------------------------------------------------------------- /Core3Mvc/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | @{ 3 | ViewData["Title"] = "Error"; 4 | } 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (Model.ShowRequestId) 10 | { 11 |

12 | Request ID: @Model.RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

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 |

26 | -------------------------------------------------------------------------------- /Core3Mvc/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /Core3Mvc/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using Core3Mvc 2 | @using Core3Mvc.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /Core3Mvc/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /Core3Mvc/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Core3Mvc/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /Core3Mvc/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/Core3Mvc/wwwroot/favicon.ico -------------------------------------------------------------------------------- /Core3Mvc/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 | -------------------------------------------------------------------------------- /Core3Mvc/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 | -------------------------------------------------------------------------------- /Core3WebApi/Controllers/StatisticsController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | 7 | namespace Core3WebApi.Controllers 8 | { 9 | [ApiController] 10 | [Route("api/[controller]")] 11 | [Produces("application/json")] 12 | public class StatisticsController : ControllerBase 13 | { 14 | [HttpGet("distribution")] 15 | public async Task GetDistribution() 16 | { 17 | return new 18 | { 19 | Id = 12345, 20 | Name = "Something", 21 | }; 22 | 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /Core3WebApi/Controllers/WeatherForecastController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace WebApplication1.Controllers 4 | { 5 | [ApiController] 6 | [Route("[controller]")] 7 | public class WeatherForecastController : ControllerBase 8 | { 9 | private static readonly string[] Summaries = new[] 10 | { 11 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" 12 | }; 13 | 14 | private readonly ILogger _logger; 15 | 16 | public WeatherForecastController(ILogger logger) 17 | { 18 | _logger = logger; 19 | } 20 | 21 | [HttpGet(Name = "GetWeatherForecast")] 22 | public IEnumerable Get() 23 | { 24 | return Enumerable.Range(1, 5).Select(index => new WeatherForecast 25 | { 26 | Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)), 27 | TemperatureC = Random.Shared.Next(-20, 55), 28 | Summary = Summaries[Random.Shared.Next(Summaries.Length)] 29 | }) 30 | .ToArray(); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Core3WebApi/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:50941", 8 | "sslPort": 44388 9 | } 10 | }, 11 | "profiles": { 12 | "IIS Express": { 13 | "commandName": "IISExpress", 14 | "launchBrowser": true, 15 | "launchUrl": "weatherforecast", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | } 19 | }, 20 | "Core3WebApi": { 21 | "commandName": "Project", 22 | "launchBrowser": true, 23 | "launchUrl": "weatherforecast", 24 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 25 | "environmentVariables": { 26 | "ASPNETCORE_ENVIRONMENT": "Development" 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Core3WebApi/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace WebApplication1 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateOnly Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Core3WebApi/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Core3WebApi/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /CoreWebApi.ClientApi/CoreWebApi.ClientApi.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net9.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /DemoCoreWebControllers/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using Microsoft.AspNetCore.Mvc; 6 | 7 | namespace DemoWebApi.Controllers 8 | { 9 | [Route("api/[controller]")] 10 | public class HomeController : Controller 11 | { 12 | [HttpGet] 13 | public ActionResult Index() 14 | { 15 | ViewBag.Title = "Home Page"; 16 | 17 | return View(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /DemoCoreWebControllers/DemoCoreWebControllers.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | True 7 | latest-minimum 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /DemoWebApi.DemoDataCore/DemoWebApi.DemoDataCore.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | true 6 | latest-minimum 7 | 8 | 9 | 10 | 1701;1702;1705;1591 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Docs/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/15993272203953158972: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/Docs/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/15993272203953158972 -------------------------------------------------------------------------------- /Docs/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/6528562391515211296: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/Docs/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/6528562391515211296 -------------------------------------------------------------------------------- /Docs/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/aframe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Docs/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/l: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/Docs/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/l -------------------------------------------------------------------------------- /Docs/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/logo250x135.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/Docs/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/logo250x135.gif -------------------------------------------------------------------------------- /Docs/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/main-app-f38f0d9153b95312.js.download: -------------------------------------------------------------------------------- 1 | (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[358],{836:(e,s,n)=>{Promise.resolve().then(n.t.bind(n,894,23)),Promise.resolve().then(n.t.bind(n,4970,23)),Promise.resolve().then(n.t.bind(n,6614,23)),Promise.resolve().then(n.t.bind(n,6975,23)),Promise.resolve().then(n.t.bind(n,7555,23)),Promise.resolve().then(n.t.bind(n,4911,23)),Promise.resolve().then(n.t.bind(n,9665,23)),Promise.resolve().then(n.t.bind(n,1295,23))},9393:()=>{}},e=>{var s=s=>e(e.s=s);e.O(0,[441,684],()=>(s(5415),s(836))),_N_E=e.O()}]); -------------------------------------------------------------------------------- /Docs/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/reach_worklet(1).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Docs/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/reach_worklet.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Docs/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/saved_resource(2).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Docs/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/saved_resource(3).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Docs/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/saved_resource(4).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Docs/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/saved_resource(5).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Docs/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/saved_resource(6).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Docs/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/sodar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/Docs/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/sodar -------------------------------------------------------------------------------- /Docs/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/starIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/Docs/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/starIcon.png -------------------------------------------------------------------------------- /Docs/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/viewsIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/Docs/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/viewsIcon.png -------------------------------------------------------------------------------- /HeroesMvc/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using HeroesMvc.Models; 2 | using Microsoft.AspNetCore.Mvc; 3 | using System.Diagnostics; 4 | 5 | namespace HeroesMvc.Controllers 6 | { 7 | public class HomeController : Controller 8 | { 9 | private readonly ILogger _logger; 10 | 11 | public HomeController(ILogger logger) 12 | { 13 | _logger = logger; 14 | } 15 | 16 | public IActionResult Index() 17 | { 18 | return View(); 19 | } 20 | 21 | public IActionResult Privacy() 22 | { 23 | return View(); 24 | } 25 | 26 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 27 | public IActionResult Error() 28 | { 29 | return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /HeroesMvc/HeroesMvc.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /HeroesMvc/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace HeroesMvc.Models 2 | { 3 | public class ErrorViewModel 4 | { 5 | public string? RequestId { get; set; } 6 | 7 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /HeroesMvc/Program.cs: -------------------------------------------------------------------------------- 1 | var builder = WebApplication.CreateBuilder(args); 2 | 3 | // Add services to the container. 4 | builder.Services.AddControllersWithViews(); 5 | 6 | var app = builder.Build(); 7 | 8 | // Configure the HTTP request pipeline. 9 | if (!app.Environment.IsDevelopment()) 10 | { 11 | app.UseExceptionHandler("/Home/Error"); 12 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 13 | app.UseHsts(); 14 | } 15 | 16 | app.UseHttpsRedirection(); 17 | app.UseRouting(); 18 | 19 | app.UseAuthorization(); 20 | 21 | app.MapStaticAssets(); 22 | 23 | app.MapControllerRoute( 24 | name: "default", 25 | pattern: "{controller=Home}/{action=Index}/{id?}") 26 | .WithStaticAssets(); 27 | 28 | 29 | app.Run(); 30 | -------------------------------------------------------------------------------- /HeroesMvc/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/launchsettings.json", 3 | "profiles": { 4 | "http": { 5 | "commandName": "Project", 6 | "dotnetRunMessages": true, 7 | "launchBrowser": true, 8 | "applicationUrl": "http://localhost:5102", 9 | "environmentVariables": { 10 | "ASPNETCORE_ENVIRONMENT": "Development" 11 | } 12 | }, 13 | "https": { 14 | "commandName": "Project", 15 | "dotnetRunMessages": true, 16 | "launchBrowser": true, 17 | "applicationUrl": "https://localhost:7173;http://localhost:5102", 18 | "environmentVariables": { 19 | "ASPNETCORE_ENVIRONMENT": "Development" 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /HeroesMvc/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 |
6 |

Welcome

7 |

Learn about building Web apps with ASP.NET Core.

8 |
9 | -------------------------------------------------------------------------------- /HeroesMvc/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.

7 | -------------------------------------------------------------------------------- /HeroesMvc/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | @{ 3 | ViewData["Title"] = "Error"; 4 | } 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (Model.ShowRequestId) 10 | { 11 |

12 | Request ID: @Model.RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

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 |

26 | -------------------------------------------------------------------------------- /HeroesMvc/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /HeroesMvc/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using HeroesMvc 2 | @using HeroesMvc.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /HeroesMvc/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /HeroesMvc/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /HeroesMvc/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /HeroesMvc/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | html { 2 | font-size: 14px; 3 | } 4 | 5 | @media (min-width: 768px) { 6 | html { 7 | font-size: 16px; 8 | } 9 | } 10 | 11 | .btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus { 12 | box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb; 13 | } 14 | 15 | html { 16 | position: relative; 17 | min-height: 100%; 18 | } 19 | 20 | body { 21 | margin-bottom: 60px; 22 | } 23 | 24 | .form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder { 25 | color: var(--bs-secondary-color); 26 | text-align: end; 27 | } 28 | 29 | .form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder { 30 | text-align: start; 31 | } -------------------------------------------------------------------------------- /HeroesMvc/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/HeroesMvc/wwwroot/favicon.ico -------------------------------------------------------------------------------- /HeroesMvc/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://learn.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 | -------------------------------------------------------------------------------- /HeroesRazor/HeroesRazor.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /HeroesRazor/Pages/Dashboard.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model HeroesRazor.Pages.DashboardModel 3 | @{ 4 | 5 | } 6 | 7 | Dashboard 8 |

Top Heroes

9 | 10 | @if (Model.Heroes == null) 11 | { 12 |

Loading Heroes...

13 | } 14 | else 15 | { 16 |
17 | @foreach (var hero in Model.Heroes.Take(4)) 18 | { 19 | string href = $"/detail/{@hero.Id}"; 20 | @hero.Name 21 | } 22 |
23 | } -------------------------------------------------------------------------------- /HeroesRazor/Pages/Dashboard.cshtml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using Microsoft.AspNetCore.Mvc.RazorPages; 3 | using DemoWebApi.Controllers.Client; 4 | 5 | 6 | namespace HeroesRazor.Pages 7 | { 8 | public class DashboardModel : PageModel 9 | { 10 | public Hero[] Heroes { get; set; } 11 | 12 | public DashboardModel(IHttpClientFactory httpClientFactory) 13 | { 14 | heroesApi = new DemoWebApi.Controllers.Client.Heroes(httpClientFactory.CreateClient("heroesApi"), new System.Text.Json.JsonSerializerOptions(System.Text.Json.JsonSerializerDefaults.Web)); 15 | } 16 | 17 | readonly DemoWebApi.Controllers.Client.Heroes heroesApi; 18 | 19 | public async Task OnGet() 20 | { 21 | Heroes = await heroesApi.GetAsyncHeroesAsync(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /HeroesRazor/Pages/Dashboard.cshtml.css: -------------------------------------------------------------------------------- 1 | /* DashboardComponent's private CSS styles */ 2 | 3 | h2 { 4 | text-align: center; 5 | } 6 | 7 | .heroes-menu { 8 | padding: 0; 9 | margin: auto; 10 | max-width: 1000px; 11 | /* flexbox */ 12 | display: -webkit-box; 13 | display: -moz-box; 14 | display: -ms-flexbox; 15 | display: -webkit-flex; 16 | display: flex; 17 | flex-direction: row; 18 | flex-wrap: wrap; 19 | justify-content: space-around; 20 | align-content: flex-start; 21 | align-items: flex-start; 22 | } 23 | 24 | a { 25 | background-color: #3f525c; 26 | border-radius: 2px; 27 | padding: 1rem; 28 | font-size: 1.2rem; 29 | text-decoration: none; 30 | display: inline-block; 31 | color: #fff; 32 | text-align: center; 33 | width: 100%; 34 | min-width: 70px; 35 | margin: .5rem auto; 36 | box-sizing: border-box; 37 | /* flexbox */ 38 | order: 0; 39 | flex: 0 1 auto; 40 | align-self: auto; 41 | } 42 | 43 | @media (min-width: 600px) { 44 | a { 45 | width: 18%; 46 | box-sizing: content-box; 47 | } 48 | } 49 | 50 | a:hover { 51 | background-color: black; 52 | } 53 | -------------------------------------------------------------------------------- /HeroesRazor/Pages/Error.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model ErrorModel 3 | @{ 4 | ViewData["Title"] = "Error"; 5 | } 6 | 7 |

Error.

8 |

An error occurred while processing your request.

9 | 10 | @if (Model.ShowRequestId) 11 | { 12 |

13 | Request ID: @Model.RequestId 14 |

15 | } 16 | 17 |

Development Mode

18 |

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 | -------------------------------------------------------------------------------- /HeroesRazor/Pages/Error.cshtml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using Microsoft.AspNetCore.Mvc.RazorPages; 3 | using System.Diagnostics; 4 | 5 | namespace HeroesRazor.Pages 6 | { 7 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 8 | [IgnoreAntiforgeryToken] 9 | public class ErrorModel : PageModel 10 | { 11 | public string? RequestId { get; set; } 12 | 13 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 14 | 15 | private readonly ILogger _logger; 16 | 17 | public ErrorModel(ILogger logger) 18 | { 19 | _logger = logger; 20 | } 21 | 22 | public void OnGet() 23 | { 24 | RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; 25 | } 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /HeroesRazor/Pages/HeroDetail.cshtml: -------------------------------------------------------------------------------- 1 | @page "/detail/{id:long}" 2 | @model HeroesRazor.Pages.HeroDetailModel 3 | @{ 4 | } 5 | 6 | Heroes 7 |

Heroes Dashboard

8 | 9 | @if (Model.Hero == null) 10 | { 11 |

Loading Hero...

12 | } 13 | else 14 | { 15 |
16 |

@Model.Hero.Name Details

17 |
id: @Model.Id
18 |
19 | 20 | 21 |
22 | 23 | 24 | 25 |
26 | } -------------------------------------------------------------------------------- /HeroesRazor/Pages/HeroDetail.cshtml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc.RazorPages; 2 | 3 | namespace HeroesRazor.Pages 4 | { 5 | public class HeroDetailModel : PageModel 6 | { 7 | public HeroDetailModel(IHttpClientFactory httpClientFactory) 8 | { 9 | heroesApi = new DemoWebApi.Controllers.Client.Heroes(httpClientFactory.CreateClient("heroesApi"), new System.Text.Json.JsonSerializerOptions(System.Text.Json.JsonSerializerDefaults.Web)); 10 | } 11 | 12 | //[Parameter] 13 | public long Id { get; set; } 14 | public DemoWebApi.Controllers.Client.Hero? Hero { get; private set; } 15 | readonly DemoWebApi.Controllers.Client.Heroes heroesApi; 16 | 17 | public async Task OnGet(long id) 18 | { 19 | Id= id; 20 | Hero = await heroesApi.GetHeroAsync(id); 21 | } 22 | 23 | public async Task Save() 24 | { 25 | await heroesApi.PutAsync(Hero); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /HeroesRazor/Pages/HeroDetail.cshtml.css: -------------------------------------------------------------------------------- 1 | /* HeroDetailComponent's private CSS styles */ 2 | label { 3 | color: #435960; 4 | font-weight: bold; 5 | } 6 | 7 | input { 8 | font-size: 1em; 9 | padding: .5rem; 10 | } 11 | 12 | button { 13 | margin-top: 20px; 14 | margin-right: .5rem; 15 | background-color: #eee; 16 | padding: 1rem; 17 | border-radius: 4px; 18 | font-size: 1rem; 19 | } 20 | 21 | button:hover { 22 | background-color: #cfd8dc; 23 | } 24 | 25 | button:disabled { 26 | background-color: #eee; 27 | color: #ccc; 28 | cursor: auto; 29 | } 30 | -------------------------------------------------------------------------------- /HeroesRazor/Pages/HeroDetail.razor.css: -------------------------------------------------------------------------------- 1 | /* HeroDetailComponent's private CSS styles */ 2 | label { 3 | color: #435960; 4 | font-weight: bold; 5 | } 6 | 7 | input { 8 | font-size: 1em; 9 | padding: .5rem; 10 | } 11 | 12 | button { 13 | margin-top: 20px; 14 | margin-right: .5rem; 15 | background-color: #eee; 16 | padding: 1rem; 17 | border-radius: 4px; 18 | font-size: 1rem; 19 | } 20 | 21 | button:hover { 22 | background-color: #cfd8dc; 23 | } 24 | 25 | button:disabled { 26 | background-color: #eee; 27 | color: #ccc; 28 | cursor: auto; 29 | } 30 | -------------------------------------------------------------------------------- /HeroesRazor/Pages/Heroes.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model HeroesRazor.Pages.HeroesModel 3 | @{ 4 | } 5 | 6 | List 7 |

My Heroes

8 | 9 | @if (@Model.heroes == null) 10 | { 11 |

Loading Heroes...

12 | } 13 | else 14 | { 15 |
16 | 17 | 18 | 19 | 22 |
23 | 24 |
    25 | @foreach (var hero in @Model.heroes) 26 | { 27 | string href = $"/detail/{hero.Id}"; 28 |
  • 29 | 30 | @hero.Id @hero.Name 31 | 32 | 33 |
  • 34 | } 35 |
36 | } -------------------------------------------------------------------------------- /HeroesRazor/Pages/Index.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model IndexModel 3 | @{ 4 | ViewData["Title"] = "Home page"; 5 | } 6 | 7 |
8 |

Welcome

9 |

Learn about building Web apps with ASP.NET Core.

10 |
11 | -------------------------------------------------------------------------------- /HeroesRazor/Pages/Index.cshtml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using Microsoft.AspNetCore.Mvc.RazorPages; 3 | 4 | namespace HeroesRazor.Pages 5 | { 6 | public class IndexModel : PageModel 7 | { 8 | private readonly ILogger _logger; 9 | 10 | public IndexModel(ILogger logger) 11 | { 12 | _logger = logger; 13 | } 14 | 15 | public void OnGet() 16 | { 17 | 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /HeroesRazor/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 | -------------------------------------------------------------------------------- /HeroesRazor/Pages/Privacy.cshtml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using Microsoft.AspNetCore.Mvc.RazorPages; 3 | 4 | namespace HeroesRazor.Pages 5 | { 6 | public class PrivacyModel : PageModel 7 | { 8 | private readonly ILogger _logger; 9 | 10 | public PrivacyModel(ILogger logger) 11 | { 12 | _logger = logger; 13 | } 14 | 15 | public void OnGet() 16 | { 17 | } 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /HeroesRazor/Pages/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /HeroesRazor/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using HeroesRazor 2 | @namespace HeroesRazor.Pages 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /HeroesRazor/Pages/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /HeroesRazor/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/launchsettings.json", 3 | "profiles": { 4 | "http": { 5 | "commandName": "Project", 6 | "dotnetRunMessages": true, 7 | "launchBrowser": true, 8 | "applicationUrl": "http://localhost:5151", 9 | "environmentVariables": { 10 | "ASPNETCORE_ENVIRONMENT": "Development" 11 | } 12 | }, 13 | "https": { 14 | "commandName": "Project", 15 | "dotnetRunMessages": true, 16 | "launchBrowser": true, 17 | "applicationUrl": "https://localhost:7282;http://localhost:5151", 18 | "environmentVariables": { 19 | "ASPNETCORE_ENVIRONMENT": "Development" 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /HeroesRazor/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "DetailedErrors": true, 3 | "Logging": { 4 | "LogLevel": { 5 | "Default": "Information", 6 | "Microsoft.AspNetCore": "Warning" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /HeroesRazor/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /HeroesRazor/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | html { 2 | font-size: 14px; 3 | } 4 | 5 | @media (min-width: 768px) { 6 | html { 7 | font-size: 16px; 8 | } 9 | } 10 | 11 | .btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus { 12 | box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb; 13 | } 14 | 15 | html { 16 | position: relative; 17 | min-height: 100%; 18 | } 19 | 20 | body { 21 | margin-bottom: 60px; 22 | } 23 | 24 | .form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder { 25 | color: var(--bs-secondary-color); 26 | text-align: end; 27 | } 28 | 29 | .form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder { 30 | text-align: start; 31 | } -------------------------------------------------------------------------------- /HeroesRazor/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/HeroesRazor/wwwroot/favicon.ico -------------------------------------------------------------------------------- /HeroesRazor/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://learn.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 | -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Droid/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Droid/Assets/AboutAndroidAssets.txt: -------------------------------------------------------------------------------- 1 | Any raw assets you want to be deployed with your application can be placed in 2 | this directory (and child directories) and given a Build Action of "AndroidAsset". 3 | 4 | These files will be deployed with your package and will be accessible using Android's 5 | AssetManager, like this: 6 | 7 | public class ReadAsset : Activity 8 | { 9 | protected override void OnCreate (Bundle bundle) 10 | { 11 | base.OnCreate (bundle); 12 | 13 | InputStream input = Assets.Open ("my_asset.txt"); 14 | } 15 | } 16 | 17 | Additionally, some Android functions will automatically load asset files: 18 | 19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf"); 20 | -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Droid/MainActivity.cs: -------------------------------------------------------------------------------- 1 | using Android.App; 2 | using Android.Content.PM; 3 | using Android.OS; 4 | 5 | namespace MauiHeroes.Droid 6 | { 7 | [Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)] 8 | public class MainActivity : MauiAppCompatActivity 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Droid/MainAndroidApplication.cs: -------------------------------------------------------------------------------- 1 | using Android.App; 2 | using Android.Runtime; 3 | 4 | namespace MauiHeroes.Droid 5 | { 6 | [Application] 7 | public class MainAndroidApplication : MauiApplication 8 | { 9 | public MainAndroidApplication(IntPtr handle, JniHandleOwnership ownership) 10 | : base(handle, ownership) 11 | { 12 | Console.WriteLine("MainAndroidApplication created"); 13 | } 14 | 15 | protected override MauiApp CreateMauiApp() => MauiAndroidProgram.CreateMauiApp(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Droid/MauiAndroidProgram.cs: -------------------------------------------------------------------------------- 1 | namespace MauiHeroes.Droid 2 | { 3 | public static class MauiAndroidProgram 4 | { 5 | public static MauiApp CreateMauiApp() 6 | { 7 | var builder = MauiApp.CreateBuilder(); 8 | 9 | builder 10 | .UseSharedMauiApp(); 11 | 12 | return builder.Build(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Droid/MauiHeroes.Droid.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0-android 5 | 23.0 6 | Exe 7 | enable 8 | enable 9 | true 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/drawable-hdpi/dotnet_bot_devices.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/drawable-hdpi/dotnet_bot_devices.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/drawable-mdpi/dotnet_bot_devices.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/drawable-mdpi/dotnet_bot_devices.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/drawable-xhdpi/dotnet_bot_devices.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/drawable-xhdpi/dotnet_bot_devices.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/drawable-xxhdpi/dotnet_bot_devices.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/drawable-xxhdpi/dotnet_bot_devices.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/drawable-xxxhdpi/dotnet_bot_devices.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/drawable-xxxhdpi/dotnet_bot_devices.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-anydpi-v26/appicon.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-anydpi-v26/appicon_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-hdpi/appicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-hdpi/appicon.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-hdpi/appicon_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-hdpi/appicon_background.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-hdpi/appicon_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-hdpi/appicon_foreground.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-mdpi/appicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-mdpi/appicon.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-mdpi/appicon_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-mdpi/appicon_background.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-mdpi/appicon_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-mdpi/appicon_foreground.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xhdpi/appicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xhdpi/appicon.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xhdpi/appicon_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xhdpi/appicon_background.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xhdpi/appicon_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xhdpi/appicon_foreground.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xxhdpi/appicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xxhdpi/appicon.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xxhdpi/appicon_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xxhdpi/appicon_background.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xxhdpi/appicon_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xxhdpi/appicon_foreground.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xxxhdpi/appicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xxxhdpi/appicon.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xxxhdpi/appicon_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xxxhdpi/appicon_background.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xxxhdpi/appicon_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xxxhdpi/appicon_foreground.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #512BD4 4 | #2B0B98 5 | #2B0B98 6 | -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | MauiHeroes 3 | 4 | -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Mac/AppDelegate.cs: -------------------------------------------------------------------------------- 1 | using Foundation; 2 | 3 | namespace MauiHeroes.Mac 4 | { 5 | [Register(nameof(AppDelegate))] 6 | public class AppDelegate : MauiUIApplicationDelegate 7 | { 8 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Mac/Assets.xcassets/AppIcon.appiconset/Icon1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Mac/Assets.xcassets/AppIcon.appiconset/Icon1024.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Mac/Assets.xcassets/AppIcon.appiconset/Icon128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Mac/Assets.xcassets/AppIcon.appiconset/Icon128.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Mac/Assets.xcassets/AppIcon.appiconset/Icon16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Mac/Assets.xcassets/AppIcon.appiconset/Icon16.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Mac/Assets.xcassets/AppIcon.appiconset/Icon256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Mac/Assets.xcassets/AppIcon.appiconset/Icon256.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Mac/Assets.xcassets/AppIcon.appiconset/Icon32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Mac/Assets.xcassets/AppIcon.appiconset/Icon32.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Mac/Assets.xcassets/AppIcon.appiconset/Icon512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Mac/Assets.xcassets/AppIcon.appiconset/Icon512.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Mac/Assets.xcassets/AppIcon.appiconset/Icon64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Mac/Assets.xcassets/AppIcon.appiconset/Icon64.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Mac/Entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 10 | 11 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Mac/Main.cs: -------------------------------------------------------------------------------- 1 | using ObjCRuntime; 2 | using UIKit; 3 | 4 | namespace MauiHeroes.Mac 5 | { 6 | public class Program 7 | { 8 | // This is the main entry point of the application. 9 | static void Main(string[] args) 10 | { 11 | // if you want to use a different Application Delegate class from "AppDelegate" 12 | // you can specify it here. 13 | UIApplication.Main(args, null, typeof(AppDelegate)); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Mac/MauiHeroes.Mac.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net9.0-maccatalyst 5 | 13.1 6 | Exe 7 | enable 8 | enable 9 | true 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Mac/MauiProgram.cs: -------------------------------------------------------------------------------- 1 | namespace MauiHeroes.Mac 2 | { 3 | public static class MauiProgram 4 | { 5 | public static MauiApp CreateMauiApp() 6 | { 7 | var builder = MauiApp.CreateBuilder(); 8 | 9 | builder 10 | .UseSharedMauiApp(); 11 | 12 | return builder.Build(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Mac/Resources/AboutMacCatalystResources.txt: -------------------------------------------------------------------------------- 1 | This folder can contain all the Mac Catalyst-specific resources that your app may use. 2 | -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Mac/Resources/dotnet_bot_devices.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Mac/Resources/dotnet_bot_devices.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Mac/Resources/dotnet_bot_devices@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Mac/Resources/dotnet_bot_devices@2x.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.Mac/Resources/dotnet_bot_devices@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Mac/Resources/dotnet_bot_devices@3x.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.WinUI/App.xaml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.WinUI/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.UI.Xaml; 2 | 3 | // To learn more about WinUI, the WinUI project structure, 4 | // and more about our project templates, see: http://aka.ms/winui-project-info. 5 | 6 | namespace MauiHeroes.WinUI 7 | { 8 | /// 9 | /// Provides application-specific behavior to supplement the default Application class. 10 | /// 11 | public partial class App : MauiWinUIApplication 12 | { 13 | /// 14 | /// Initializes the singleton application object. This is the first line of authored code 15 | /// executed, and as such is the logical equivalent of main() or WinMain(). 16 | /// 17 | public App() 18 | { 19 | this.InitializeComponent(); 20 | } 21 | 22 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/AboutWinUIAssets.txt: -------------------------------------------------------------------------------- 1 | This folder can contain all the Windows-specific assets that your app may use. 2 | 3 | Accessing items here can be done using the `ms-appx` uri sceme; 4 | 5 | For example, if there is a file: 6 | 7 | \Assets\my_image.png 8 | 9 | This can be accessed with the uri: 10 | 11 | ms-appx:///Assets/my_image.png 12 | 13 | The files in the root ofthe Assets folder are meant to only be accessible from 14 | the Windows-specific files - such as the Package.appxmanifest. When using an 15 | asset for the manifest, you would refer to it with the `Asset\` prefix. 16 | 17 | For images that are meant to be accessed from cross-platform code, like XAML 18 | files, images should be placed into the `Assets\Images` folder as those are 19 | packaged differently to ensure the path matches that for the other platforms. 20 | 21 | For more information, see the Assets\ImagesAboutWinUIImages.txt file. 22 | -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Images/AboutWinUIImages.txt: -------------------------------------------------------------------------------- 1 | This folder can contain all the Windows-specific images that your app may use. 2 | 3 | The images in the `Images` sub folder are easily accessible in cross-platform 4 | code because they are packaged in the root of the application making them 5 | have a similar path to the other platforms. 6 | 7 | For example, if there is a file: 8 | 9 | /Assets/Images/my_image.png 10 | 11 | This can be accessed with the same code as the other platforms in shared code: 12 | 13 | 14 | -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Images/dotnet_bot_devices.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Images/dotnet_bot_devices.scale-100.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Images/dotnet_bot_devices.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Images/dotnet_bot_devices.scale-125.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Images/dotnet_bot_devices.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Images/dotnet_bot_devices.scale-150.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Images/dotnet_bot_devices.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Images/dotnet_bot_devices.scale-200.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Images/dotnet_bot_devices.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Images/dotnet_bot_devices.scale-400.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/LockScreenLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/LockScreenLogo.scale-200.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Square44x44Logo.targetsize-24_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Square44x44Logo.targetsize-24_altform-unplated.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/StoreLogo.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.WinUI/MauiProgram.cs: -------------------------------------------------------------------------------- 1 | namespace MauiHeroes.WinUI 2 | { 3 | public static class MauiProgram 4 | { 5 | public static MauiApp CreateMauiApp() 6 | { 7 | var builder = MauiApp.CreateBuilder(); 8 | 9 | builder 10 | .UseSharedMauiApp(); 11 | 12 | return builder.Build(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.WinUI/Properties/PublishProfiles/win10-arm64.pubxml: -------------------------------------------------------------------------------- 1 |  2 | 5 | 6 | 7 | FileSystem 8 | ARM64 9 | win10-arm64 10 | bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ 11 | true 12 | False 13 | False 14 | True 15 | 19 | 20 | -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.WinUI/Properties/PublishProfiles/win10-x64.pubxml: -------------------------------------------------------------------------------- 1 |  2 | 5 | 6 | 7 | FileSystem 8 | x64 9 | win10-x64 10 | bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ 11 | true 12 | False 13 | False 14 | True 15 | 19 | 20 | -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.WinUI/Properties/PublishProfiles/win10-x86.pubxml: -------------------------------------------------------------------------------- 1 |  2 | 5 | 6 | 7 | FileSystem 8 | x86 9 | win10-x86 10 | bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ 11 | true 12 | False 13 | False 14 | True 15 | 19 | 20 | -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.WinUI/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Windows Machine": { 4 | "commandName": "MsixPackage", 5 | "nativeDebugging": true 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.WinUI/app.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | PerMonitorV2 18 | 19 | 20 | -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.iOS/AppDelegate.cs: -------------------------------------------------------------------------------- 1 | using Foundation; 2 | 3 | namespace MauiHeroes.iOS 4 | { 5 | [Register(nameof(AppDelegate))] 6 | public class AppDelegate : MauiUIApplicationDelegate 7 | { 8 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon120.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon152.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon167.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon167.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon180.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon20.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon29.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon40.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon58.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon60.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon76.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon80.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon87.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.iOS/Entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.iOS/Main.cs: -------------------------------------------------------------------------------- 1 | using ObjCRuntime; 2 | using UIKit; 3 | 4 | namespace MauiHeroes.iOS 5 | { 6 | public class Program 7 | { 8 | // This is the main entry point of the application. 9 | static void Main(string[] args) 10 | { 11 | // if you want to use a different Application Delegate class from "AppDelegate" 12 | // you can specify it here. 13 | UIApplication.Main(args, null, typeof(AppDelegate)); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.iOS/MauiProgram.cs: -------------------------------------------------------------------------------- 1 | namespace MauiHeroes.iOS 2 | { 3 | public static class MauiProgram 4 | { 5 | public static MauiApp CreateMauiApp() 6 | { 7 | var builder = MauiApp.CreateBuilder(); 8 | 9 | builder 10 | .UseSharedMauiApp(); 11 | 12 | return builder.Build(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.iOS/Resources/AboutiOSResources.txt: -------------------------------------------------------------------------------- 1 | This folder can contain all the iOS-specific resources that your app may use. 2 | -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.iOS/Resources/dotnet_bot_devices.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.iOS/Resources/dotnet_bot_devices.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.iOS/Resources/dotnet_bot_devices@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.iOS/Resources/dotnet_bot_devices@2x.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes.iOS/Resources/dotnet_bot_devices@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.iOS/Resources/dotnet_bot_devices@3x.png -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes/App.xaml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.Maui.Controls.Xaml; 3 | using Microsoft.Maui.Controls; 4 | using Microsoft.Maui; 5 | 6 | [assembly: XamlCompilation(XamlCompilationOptions.Compile)] 7 | namespace Fonlow.Heroes 8 | { 9 | public partial class App : Application 10 | { 11 | public App() 12 | { 13 | InitializeComponent(); 14 | 15 | MainPage = new NavigationPage(new Views.MainTabbedPage()); 16 | } 17 | 18 | protected override void OnStart() 19 | { 20 | // Handle when your app starts 21 | } 22 | 23 | protected override void OnSleep() 24 | { 25 | // Handle when your app sleeps 26 | } 27 | 28 | protected override void OnResume() 29 | { 30 | // Handle when your app resumes 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes/MauiProgramExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Logging; 2 | 3 | namespace MauiHeroes 4 | { 5 | public static class MauiProgramExtensions 6 | { 7 | public static MauiAppBuilder UseSharedMauiApp(this MauiAppBuilder builder) 8 | { 9 | builder 10 | .UseMauiApp() 11 | .ConfigureFonts(fonts => 12 | { 13 | fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); 14 | fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); 15 | }); 16 | 17 | #if DEBUG 18 | builder.Logging.AddDebug(); 19 | #endif 20 | 21 | return builder; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes/Resources/Fonts/OpenSans-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes/Resources/Fonts/OpenSans-Regular.ttf -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes/Resources/Fonts/OpenSans-Semibold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes/Resources/Fonts/OpenSans-Semibold.ttf -------------------------------------------------------------------------------- /MauiMulti/MauiHeroes/MauiHeroes/Resources/Raw/AboutAssets.txt: -------------------------------------------------------------------------------- 1 | Any raw assets you want to be deployed with your application can be placed in 2 | this directory (and child directories). Deployment of the asset to your application 3 | is automatically handled by the following `MauiAsset` Build Action within your `.csproj`. 4 | 5 | 6 | 7 | These files will be deployed with your package and will be accessible using Essentials: 8 | 9 | async Task LoadMauiAsset() 10 | { 11 | using var stream = await FileSystem.OpenAppPackageFileAsync("AboutAssets.txt"); 12 | using var reader = new StreamReader(stream); 13 | 14 | var contents = reader.ReadToEnd(); 15 | } 16 | -------------------------------------------------------------------------------- /ReactHeroes/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /ReactHeroes/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | moduleFileExtensions: [ 3 | 'js', 4 | 'jsx', 5 | 'json', 6 | 'vue', 7 | 'ts', 8 | 'tsx' 9 | ], 10 | 11 | transform: { 12 | '^.+\\.vue$': 'vue-jest', 13 | '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub', 14 | '^.+\\.tsx?$': 'ts-jest' 15 | }, 16 | 17 | testEnvironmentOptions: { 18 | url: 'http://localhost:4201', 19 | customExportConditions: ["node", "node-addons"], 20 | }, 21 | moduleNameMapper: { 22 | '^@/(.*)$': '/src/$1' 23 | }, 24 | snapshotSerializers: [ 25 | 'jest-serializer-vue' 26 | ], 27 | testMatch: [ 28 | '**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)' 29 | ], 30 | "compilerOptions": { 31 | "types": ["vitest/globals"] 32 | }, 33 | 34 | watchPlugins: [ 35 | 'jest-watch-typeahead/filename', 36 | 'jest-watch-typeahead/testname' 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /ReactHeroes/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/ReactHeroes/public/favicon.ico -------------------------------------------------------------------------------- /ReactHeroes/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/ReactHeroes/public/logo192.png -------------------------------------------------------------------------------- /ReactHeroes/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/ReactHeroes/public/logo512.png -------------------------------------------------------------------------------- /ReactHeroes/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /ReactHeroes/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /ReactHeroes/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /ReactHeroes/src/App.tsx: -------------------------------------------------------------------------------- 1 | import { BrowserRouter, useRoutes } from 'react-router-dom'; 2 | import './App.css'; 3 | import Dashboard from './Dashboard'; 4 | import Demo from './Demo'; 5 | import HeroDetail from './HeroDetail'; 6 | import Heroes from './Heroes'; 7 | import Home from './Home'; 8 | 9 | function AppRouteMap() { 10 | return useRoutes([ 11 | { path: 'demo', element: }, 12 | { path: '/', element: }, 13 | { 14 | element: , 15 | children: [ 16 | { path: 'dashboard', element: }, 17 | { path: 'heroes', element: }, 18 | { path: 'detail/:id', element: } 19 | ] 20 | } 21 | ]); 22 | 23 | } 24 | 25 | export default function App() { 26 | return ( 27 | 28 | 29 | 30 | ); 31 | } 32 | -------------------------------------------------------------------------------- /ReactHeroes/src/Demo.tsx: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import logo from './logo.svg'; 3 | import './App.css'; 4 | 5 | export default class Demo extends Component { 6 | render(): React.ReactNode { 7 | return ( 8 |
9 |
10 | logo 11 |

12 | Edit src/App.tsx and save to reload. 13 |

14 | 20 | Learn React 21 | 22 |
23 |
24 | ); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ReactHeroes/src/HeroDetail.css: -------------------------------------------------------------------------------- 1 | /* HeroDetailComponent's private CSS styles */ 2 | label { 3 | color: #435960; 4 | font-weight: bold; 5 | } 6 | input { 7 | font-size: 1em; 8 | padding: .5rem; 9 | } 10 | button { 11 | margin-top: 20px; 12 | margin-right: .5rem; 13 | background-color: #eee; 14 | padding: 1rem; 15 | border-radius: 4px; 16 | font-size: 1rem; 17 | } 18 | button:hover { 19 | background-color: #cfd8dc; 20 | } 21 | button:disabled { 22 | background-color: #eee; 23 | color: #ccc; 24 | cursor: auto; 25 | } 26 | -------------------------------------------------------------------------------- /ReactHeroes/src/HeroesApi.tsx: -------------------------------------------------------------------------------- 1 | import { DemoWebApi_Controllers_Client } from './clientapi/WebApiCoreAxiosClientAuto'; 2 | 3 | export let HeroesApi = heroesApi(); 4 | function heroesApi() { 5 | const apiBaseUri = 'http://localhost:5000/'; 6 | const service = new DemoWebApi_Controllers_Client.Heroes(apiBaseUri); 7 | return service; 8 | 9 | } 10 | 11 | -------------------------------------------------------------------------------- /ReactHeroes/src/Home.tsx: -------------------------------------------------------------------------------- 1 | import { Link, Outlet } from 'react-router-dom'; 2 | import './HeroDetail.css'; 3 | 4 | export default function Home() { 5 | 6 | return ( 7 | <> 8 |

React Heroes!

9 | 13 | 14 | 15 | 16 | ); 17 | 18 | } 19 | 20 | -------------------------------------------------------------------------------- /ReactHeroes/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /ReactHeroes/src/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom/client'; 3 | import './index.css'; 4 | import App from './App'; 5 | import reportWebVitals from './reportWebVitals'; 6 | 7 | const root = ReactDOM.createRoot( 8 | document.getElementById('root') as HTMLElement 9 | ); 10 | root.render( 11 | 12 | 13 | 14 | ); 15 | 16 | // If you want to start measuring performance in your app, pass a function 17 | // to log results (for example: reportWebVitals(console.log)) 18 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 19 | reportWebVitals(); 20 | -------------------------------------------------------------------------------- /ReactHeroes/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /ReactHeroes/src/reportWebVitals.ts: -------------------------------------------------------------------------------- 1 | import { ReportHandler } from 'web-vitals'; 2 | 3 | const reportWebVitals = (onPerfEntry?: ReportHandler) => { 4 | if (onPerfEntry && onPerfEntry instanceof Function) { 5 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 6 | getCLS(onPerfEntry); 7 | getFID(onPerfEntry); 8 | getFCP(onPerfEntry); 9 | getLCP(onPerfEntry); 10 | getTTFB(onPerfEntry); 11 | }); 12 | } 13 | }; 14 | 15 | export default reportWebVitals; 16 | -------------------------------------------------------------------------------- /ReactHeroes/src/setupTests.ts: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /ReactHeroes/startApp.bat: -------------------------------------------------------------------------------- 1 | ::Run `npm run build` for prod build first. https://create-react-app.dev/docs/production-build 2 | ::Launch local Web API 3 | ::Then use in Web browser 4 | 5 | dotnet-serve -d build\ -p 5400 6 | -------------------------------------------------------------------------------- /ReactHeroes/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "lib": [ 5 | "dom", 6 | "dom.iterable", 7 | "es2022" 8 | ], 9 | "allowJs": true, 10 | "skipLibCheck": true, 11 | "esModuleInterop": true, 12 | "allowSyntheticDefaultImports": true, 13 | "strict": true, 14 | "forceConsistentCasingInFileNames": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "module": "es2022", 17 | "moduleResolution": "node", 18 | "resolveJsonModule": true, 19 | "isolatedModules": true, 20 | "noEmit": true, 21 | "jsx": "react-jsx" 22 | }, 23 | "include": [ 24 | "src" 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /StartCoreMvc.ps1: -------------------------------------------------------------------------------- 1 | #Launch WebApi Website and POST a request for generating client APIs 2 | cd $PSScriptRoot 3 | $path = "$PSScriptRoot/Core3MVC" 4 | $procArgs = @{ 5 | FilePath = "dotnet.exe" 6 | ArgumentList = "run --project $path/Core3MVC.csproj --no-build" 7 | WorkingDirectory = $path 8 | PassThru = $true 9 | } 10 | $process = Start-Process @procArgs 11 | 12 | Invoke-RestMethod http://localhost:5000/api/values -Method GET 13 | 14 | -------------------------------------------------------------------------------- /StartCoreWebApi.ps1: -------------------------------------------------------------------------------- 1 | #Launch WebApi Website and POST a request for generating client APIs 2 | cd $PSScriptRoot 3 | $path = "$PSScriptRoot\Core3WebApi" 4 | $procArgs = @{ 5 | FilePath = "$path/bin/Debug/net9.0/Core3WebApi.exe" 6 | WorkingDirectory = $path 7 | PassThru = $true 8 | } 9 | $process = Start-Process @procArgs 10 | 11 | Invoke-RestMethod http://localhost:5000/api/DateTypes/ForDateTimeOffset -Method GET 12 | Invoke-RestMethod http://localhost:5000/api/DateTypes/GetDateOnlyMin -Method GET 13 | Invoke-RestMethod http://localhost:5000/WeatherForecast -Method GET 14 | 15 | -------------------------------------------------------------------------------- /Tests/IntegrationTestsTextJson/DateTypesFixture.cs: -------------------------------------------------------------------------------- 1 | using Fonlow.Testing; 2 | 3 | namespace IntegrationTests 4 | { 5 | public class DateTypesFixture : BasicHttpClient 6 | { 7 | public DateTypesFixture() 8 | { 9 | System.Text.Json.JsonSerializerOptions jsonSerializerSettings = new System.Text.Json.JsonSerializerOptions() 10 | { 11 | DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, 12 | PropertyNameCaseInsensitive = true, 13 | }; 14 | 15 | //jsonSerializerSettings.Converters.Add(new DateOnlyJsonConverter()); for .NET 6, no need in .NET 7, 8, 16 | //jsonSerializerSettings.Converters.Add(new DateOnlyNullableJsonConverter()); 17 | var c = TestingSettings.Instance.ServiceCommands["LaunchWebApi"]; 18 | this.HttpClient.BaseAddress = new System.Uri(c.BaseUrl); 19 | Api = new DemoWebApi.Controllers.Client.DateTypes(HttpClient, jsonSerializerSettings); 20 | } 21 | 22 | public DemoWebApi.Controllers.Client.DateTypes Api { get; private set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Tests/IntegrationTestsTextJson/DotNetHostCollection.cs: -------------------------------------------------------------------------------- 1 | using Xunit; 2 | 3 | namespace IntegrationTests 4 | { 5 | public class TestConstants 6 | { 7 | public const string LaunchWebApiAndInit = "LaunchWebApi"; 8 | } 9 | 10 | [CollectionDefinition(TestConstants.LaunchWebApiAndInit)] 11 | public class DotNetHostCollection : ICollectionFixture 12 | { 13 | // This class has no code, and is never created. Its purpose is simply 14 | // to be the place to apply [CollectionDefinition] and all the 15 | // ICollectionFixture<> interfaces. 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Tests/IntegrationTestsTextJson/README.md: -------------------------------------------------------------------------------- 1 | For testing the runtime behavior of .NET Core Client API codes utilizing System.Text.Json rather than Newtonsoft.Json. 2 | 3 | The primary test endpoint is DemoTextJsonWeb. And DemoCoreWeb that uses Newtonsoft.Json should be used as well from time to time. 4 | 5 | **Hints:** 6 | 7 | * When testing with DemoCoreWeb, just launch DemoCoreWeb first, then the auto launch of DemoTextJsonWeb will fail, and the test suite will actually talk to DemoCoreWeb. 8 | 9 | 10 | **Remarks:** 11 | 12 | * As of .NET 3, 5, 6, 7 and 8, System.Text.Json has been approaching total replacement of Newtonsoft.Json, covering more and more CLR strongly typed data models. 13 | * However, as of .NET 8, there are still around 6 test cases failed revealing that what System.Text.Json is not yet capable of, when talking to DemoTextJsonWeb. Please read the doc documents of failed cases for details. 14 | * When talking to DemoCoreWeb, 4 cases failed. 15 | * Class TextJsonNegativeCases documents the behaviors of system.text.json.JsonSerilizer, related to the failed integration test cases. 16 | -------------------------------------------------------------------------------- /Tests/IntegrationTestsTextJson/SpecialTypesFixture.cs: -------------------------------------------------------------------------------- 1 | using Fonlow.Testing; 2 | 3 | namespace IntegrationTests 4 | { 5 | public class SpecialTypesFixture : BasicHttpClient 6 | { 7 | public SpecialTypesFixture() 8 | { 9 | var c = TestingSettings.Instance.ServiceCommands["LaunchWebApi"]; 10 | this.HttpClient.BaseAddress = new System.Uri(c.BaseUrl); 11 | Api = new DemoCoreWeb.Controllers.Client.SpecialTypes(HttpClient); 12 | } 13 | 14 | public DemoCoreWeb.Controllers.Client.SpecialTypes Api { get; private set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Tests/IntegrationTestsTextJson/StringDataFixture.cs: -------------------------------------------------------------------------------- 1 | using Fonlow.Testing; 2 | 3 | namespace IntegrationTests 4 | { 5 | public class StringDataFixture : BasicHttpClient 6 | { 7 | public StringDataFixture() 8 | { 9 | var c = TestingSettings.Instance.ServiceCommands["LaunchWebApi"]; 10 | this.HttpClient.BaseAddress = new System.Uri(c.BaseUrl); 11 | Api = new DemoWebApi.Controllers.Client.StringData(HttpClient); 12 | } 13 | 14 | public DemoWebApi.Controllers.Client.StringData Api { get; private set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Tests/IntegrationTestsTextJson/SuperDemoFixture.cs: -------------------------------------------------------------------------------- 1 | using Fonlow.Testing; 2 | 3 | namespace IntegrationTests 4 | { 5 | public class SuperDemoFixture : BasicHttpClient 6 | { 7 | public SuperDemoFixture() 8 | { 9 | System.Text.Json.JsonSerializerOptions jsonSerializerSettings = new System.Text.Json.JsonSerializerOptions() 10 | { 11 | DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault, 12 | PropertyNameCaseInsensitive = true, 13 | NumberHandling = System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString 14 | }; 15 | 16 | var c = TestingSettings.Instance.ServiceCommands["LaunchWebApi"]; 17 | this.HttpClient.BaseAddress = new System.Uri(c.BaseUrl); 18 | Api = new DemoWebApi.Controllers.Client.SuperDemo(HttpClient, jsonSerializerSettings); 19 | } 20 | 21 | public DemoWebApi.Controllers.Client.SuperDemo Api { get; private set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Tests/IntegrationTestsTextJson/TextDataFixture.cs: -------------------------------------------------------------------------------- 1 | using Fonlow.Testing; 2 | 3 | namespace IntegrationTests 4 | { 5 | public class TextDataFixture : BasicHttpClient 6 | { 7 | public TextDataFixture() 8 | { 9 | var c = TestingSettings.Instance.ServiceCommands["LaunchWebApi"]; 10 | this.HttpClient.BaseAddress = new System.Uri(c.BaseUrl); 11 | Api = new DemoWebApi.Controllers.Client.TextData(HttpClient); 12 | } 13 | 14 | public DemoWebApi.Controllers.Client.TextData Api { get; private set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Tests/IntegrationTestsTextJson/ValuesFixture.cs: -------------------------------------------------------------------------------- 1 | using Fonlow.Testing; 2 | 3 | namespace IntegrationTests 4 | { 5 | public class ValuesFixture : BasicHttpClient 6 | { 7 | public ValuesFixture() 8 | { 9 | //httpClient.DefaultRequestHeaders 10 | // .Accept 11 | // .Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));//.net core has different behavior as described at https://github.com/zijianhuang/webapiclientgen/issues/26 12 | 13 | var c = TestingSettings.Instance.ServiceCommands["LaunchWebApi"]; 14 | this.HttpClient.BaseAddress = new System.Uri(c.BaseUrl); 15 | Api = new DemoWebApi.Controllers.Client.Values(HttpClient); 16 | } 17 | 18 | public DemoWebApi.Controllers.Client.Values Api { get; private set; } 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Tests/IntegrationTestsTextJson/WeatherForecastFixture.cs: -------------------------------------------------------------------------------- 1 | using Fonlow.Testing; 2 | 3 | namespace IntegrationTests 4 | { 5 | public class WeatherForecastFixture : BasicHttpClient 6 | { 7 | public WeatherForecastFixture() 8 | { 9 | //httpClient.DefaultRequestHeaders 10 | // .Accept 11 | // .Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));//.net core has different behavior as described at https://github.com/zijianhuang/webapiclientgen/issues/26 12 | 13 | var c = TestingSettings.Instance.ServiceCommands["LaunchWebApi"]; 14 | this.HttpClient.BaseAddress = new System.Uri(c.BaseUrl); 15 | Api = new WebApplication1.Controllers.Client.WeatherForecast(HttpClient); 16 | } 17 | 18 | public WebApplication1.Controllers.Client.WeatherForecast Api { get; private set; } 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Tests/IntegrationTestsTextJson/WeatherForecastIntegration.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using System.Threading.Tasks; 3 | using Xunit; 4 | namespace IntegrationTests 5 | { 6 | [Collection(TestConstants.LaunchWebApiAndInit)] 7 | public partial class WeatherForecastApiIntegration : IClassFixture 8 | { 9 | public WeatherForecastApiIntegration(WeatherForecastFixture fixture) 10 | { 11 | api = fixture.Api; 12 | } 13 | 14 | readonly WebApplication1.Controllers.Client.WeatherForecast api; 15 | 16 | [Fact] 17 | public void TestGet() 18 | { 19 | //var task = authorizedClient.GetStringAsync(new Uri(baseUri, "api/WeatherForecast")); 20 | //var text = task.Result; 21 | //var array = JArray.Parse(text); 22 | var array = api.Get(); 23 | Assert.NotEmpty(array); 24 | } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Tests/IntegrationTestsTextJson/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Testing": { 3 | "ServiceCommands": { 4 | "LaunchWebApi": { 5 | "CommandPath": "../../../../../Core3WebApi/bin/{BuildConfiguration}/net9.0/Core3WebApi{ExecutableExt}", 6 | "BaseUrl": "http://localhost:5000/", 7 | "Delay": 5 8 | } 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /fetchapi/karma.conf.js: -------------------------------------------------------------------------------- 1 | module.exports = function(config) { 2 | config.set({ 3 | frameworks: ["jasmine", "karma-typescript"], 4 | files: [ 5 | { pattern: "node_modules/reflect-metadata/Reflect.js", include: true }, 6 | "src/**/*.ts" // *.tsx for React Jsx 7 | ], 8 | preprocessors: { 9 | "**/*.ts": "karma-typescript" // *.tsx for React Jsx 10 | }, 11 | reporters: ["kjhtml", "karma-typescript"], 12 | client: { 13 | clearContext: false // leave Jasmine Spec Runner output visible in browser 14 | }, 15 | browsers: ["Chrome"] 16 | }); 17 | }; -------------------------------------------------------------------------------- /fetchapi/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "@types/jasmine": "^5.1.0", 4 | "jasmine": "^5.1.0", 5 | "karma": "^6.4.2", 6 | "karma-chrome-launcher": "^3.2.0", 7 | "karma-jasmine": "^5.1.0", 8 | "karma-jasmine-html-reporter": "^2.1.0", 9 | "karma-typescript": "^5.5.4", 10 | "reflect-metadata": "^0.1.13" 11 | }, 12 | "dependencies": { 13 | "moment": "^2.29.4", 14 | "typescript": "^5.2.2" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /fetchapi/readme.txt: -------------------------------------------------------------------------------- 1 | To test, run: 2 | 0: Npm install 3 | 0.1: npm install -g karma-cli 4 | 1: start .net core web api 5 | 2: karma start ./karma.conf.js 6 | -------------------------------------------------------------------------------- /fetchapi/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "sourceMap": true, 5 | "declaration": false, 6 | "moduleResolution": "node", 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "target": "es2015", 10 | "typeRoots": [ 11 | "node_modules/@types" 12 | ], 13 | "lib": [ 14 | "es2015", 15 | "dom" 16 | ], 17 | "skipLibCheck": true 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /mobile/Fonlow.MauiHeroes.ViewModels/Fonlow.MauiHeroes.ViewModels.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /mobile/Fonlow.MauiHeroes.Views/Dashboard.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Microsoft.Maui.Controls.Xaml; 7 | using Fonlow.Heroes.VM; 8 | using Microsoft.Maui.Controls; 9 | using Microsoft.Maui; 10 | 11 | namespace Fonlow.Heroes.Views 12 | { 13 | [XamlCompilation(XamlCompilationOptions.Compile)] 14 | public partial class Dashboard : ContentView 15 | { 16 | public Dashboard () 17 | { 18 | InitializeComponent (); 19 | 20 | } 21 | 22 | HeroesVM Model 23 | { 24 | get 25 | { 26 | return BindingContext as HeroesVM; 27 | } 28 | } 29 | 30 | 31 | async void HeroesListView_ItemSelected(object sender, SelectedItemChangedEventArgs e) 32 | { 33 | await Navigation.PushAsync(new HeroDetailPage(Model.Selected.Id)); 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /mobile/Fonlow.MauiHeroes.Views/HeroDetailPage.xaml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 |