├── .gitignore ├── BuildVersionDemo ├── BuildVersionDemo.sln └── BuildVersionDemo │ ├── BuildVersionDemo.csproj │ ├── Controllers │ ├── AppInfoController.cs │ └── WeatherForecastController.cs │ ├── Models │ └── AppInfo.cs │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ └── appsettings.json ├── Chatbot ├── .vscode │ ├── launch.json │ └── tasks.json ├── Chatbot.sln └── Chatbot │ ├── Chatbot.csproj │ ├── Program.cs │ ├── SentencesHelper.cs │ ├── TaskExecutor.cs │ ├── TextChatbot.cs │ └── VoiceChatbot.cs ├── CodeCampWellington2024Demo └── CodeCampWellington2024 │ ├── CodeCampWellington2024.sln │ ├── CodeCampWellington2024 │ ├── ChatV1 │ │ └── ChatDemoV1.cs │ ├── ChatV2 │ │ └── ChatDemoV2.cs │ ├── ChatV3 │ │ └── ChatDemoV3.cs │ ├── ChatV4 │ │ └── ChatDemoV4.cs │ ├── CodeCampWellington2024.csproj │ ├── Helpers.cs │ ├── OpenAiOptions.cs │ ├── Program.cs │ └── appsettings.json │ └── prompts.md ├── CodeGeneratorDemo ├── CodeGeneratorDemo.Client │ ├── CodeGeneratorDemo.Client.csproj │ ├── Core │ │ ├── DIContainerMocker.cs │ │ ├── IOrderService.cs │ │ ├── IProductService.cs │ │ ├── OrderService.cs │ │ └── ProductService.cs │ └── Program.cs ├── CodeGeneratorDemo.CodeSnippetsDemo │ ├── CodeGeneratorDemo.CodeSnippetsDemo.csproj │ ├── MyCodeSnippets │ │ └── xUnitSnippet.snippet │ ├── UnitTest1.cs │ └── Usings.cs ├── CodeGeneratorDemo.ReflectionDemo.Core │ ├── ChineseSpeaker.cs │ ├── CodeGeneratorDemo.ReflectionDemo.Core.csproj │ ├── EnglishSpeaker.cs │ └── ISpeaker.cs ├── CodeGeneratorDemo.ReflectionDemo │ ├── CodeGeneratorDemo.ReflectionDemo.csproj │ └── ReflectionHelper.cs ├── CodeGeneratorDemo.SourceGeneratorDemo │ ├── AutoRegisterSourceGenerator.cs │ ├── CodeGeneratorDemo.SourceGeneratorDemo.csproj │ └── SpeakersSourceGenerator.cs ├── CodeGeneratorDemo.T4TemplateDemo │ ├── CodeGeneratorDemo.T4TemplateDemo.csproj │ ├── DesignTimeTextTemplateDemo.cs │ ├── DesignTimeTextTemplateDemo.tt │ ├── RunTimeTextTemplateDemo.cs │ ├── RunTimeTextTemplateDemo.tt │ └── dataSource.txt └── CodeGeneratorDemo.sln ├── DotNetConf2020Demo ├── .vscode │ ├── launch.json │ └── tasks.json ├── AntDesignBlazorDemo │ ├── AntDesignBlazorDemo.csproj │ ├── App.razor │ ├── Components │ │ └── GlobalHeader │ │ │ ├── RightContent.razor │ │ │ └── RightContent.razor.cs │ ├── Extensions │ │ └── DateTimeExtension.cs │ ├── Layouts │ │ ├── BasicLayout.razor │ │ ├── UserLayout.razor │ │ └── UserLayout.razor.less │ ├── Models │ │ ├── ActivitiesType.cs │ │ ├── ActivityGroup.cs │ │ ├── ActivityProject.cs │ │ ├── ActivityUser.cs │ │ ├── AdvancedOperation.cs │ │ ├── AdvancedProfileData.cs │ │ ├── BasicGood.cs │ │ ├── BasicProfileDataType.cs │ │ ├── BasicProgress.cs │ │ ├── ChartData.cs │ │ ├── ChartDataItem.cs │ │ ├── CurrentUser.cs │ │ ├── FormModel.cs │ │ ├── ListFormModel.cs │ │ ├── ListItemDataType.cs │ │ ├── LoginParamsType.cs │ │ ├── NoticeItem.cs │ │ ├── NoticeType.cs │ │ ├── OfflineChartDataItem.cs │ │ ├── OfflineDataItem.cs │ │ ├── RadarDataItem.cs │ │ └── SearchDataItem.cs │ ├── Pages │ │ ├── Account │ │ │ ├── Center │ │ │ │ ├── Components │ │ │ │ │ ├── Applications │ │ │ │ │ │ ├── Applications.razor │ │ │ │ │ │ ├── Applications.razor.cs │ │ │ │ │ │ └── Applications.razor.less │ │ │ │ │ ├── ArticleListContent │ │ │ │ │ │ ├── ArticleListContent.razor │ │ │ │ │ │ └── ArticleListContent.razor.less │ │ │ │ │ ├── Articles │ │ │ │ │ │ ├── Articles.razor │ │ │ │ │ │ ├── Articles.razor.cs │ │ │ │ │ │ └── Articles.razor.less │ │ │ │ │ ├── AvatarList │ │ │ │ │ │ ├── AvatarList.razor │ │ │ │ │ │ ├── AvatarList.razor.cs │ │ │ │ │ │ ├── AvatarList.razor.less │ │ │ │ │ │ ├── AvatarListItem.razor │ │ │ │ │ │ └── AvatarListItem.razor.cs │ │ │ │ │ └── Projects │ │ │ │ │ │ ├── Projects.razor │ │ │ │ │ │ ├── Projects.razor.cs │ │ │ │ │ │ └── Projects.razor.less │ │ │ │ ├── Index.razor │ │ │ │ ├── Index.razor.cs │ │ │ │ └── Index.razor.less │ │ │ └── Settings │ │ │ │ ├── Components │ │ │ │ ├── BaseView.razor │ │ │ │ ├── BaseView.razor.cs │ │ │ │ ├── BaseView.razor.less │ │ │ │ ├── BindingView.razor │ │ │ │ ├── BindingView.razor.cs │ │ │ │ ├── GeographicView.razor │ │ │ │ ├── GeographicView.razor.less │ │ │ │ ├── NotificationView.razor │ │ │ │ ├── NotificationView.razor.cs │ │ │ │ ├── PhoneView.razor │ │ │ │ ├── PhoneView.razor.less │ │ │ │ ├── SecurityView.razor │ │ │ │ └── SecurityView.razor.cs │ │ │ │ ├── Index.razor │ │ │ │ ├── Index.razor.cs │ │ │ │ └── Index.razor.less │ │ ├── Dashboard │ │ │ ├── Analysis │ │ │ │ ├── Components │ │ │ │ │ ├── Charts │ │ │ │ │ │ ├── Bar │ │ │ │ │ │ │ └── Bar.razor │ │ │ │ │ │ ├── ChartCard │ │ │ │ │ │ │ ├── ChartCard.razor │ │ │ │ │ │ │ ├── ChartCard.razor.cs │ │ │ │ │ │ │ └── ChartCard.razor.less │ │ │ │ │ │ ├── Field │ │ │ │ │ │ │ ├── Field.razor │ │ │ │ │ │ │ ├── Field.razor.cs │ │ │ │ │ │ │ └── Field.razor.less │ │ │ │ │ │ ├── Gauge │ │ │ │ │ │ │ └── Gauge.razor │ │ │ │ │ │ ├── MiniArea │ │ │ │ │ │ │ ├── MiniArea.razor │ │ │ │ │ │ │ └── MiniArea.razor.cs │ │ │ │ │ │ ├── MiniBar │ │ │ │ │ │ │ └── MiniBar.razor │ │ │ │ │ │ ├── MiniProgress │ │ │ │ │ │ │ ├── MiniProgress.razor │ │ │ │ │ │ │ └── MiniProgress.razor.less │ │ │ │ │ │ ├── Pie │ │ │ │ │ │ │ ├── Pie.razor │ │ │ │ │ │ │ └── Pie.razor.less │ │ │ │ │ │ ├── TagCloud │ │ │ │ │ │ │ ├── TagCloud.razor │ │ │ │ │ │ │ └── TagCloud.razor.less │ │ │ │ │ │ ├── TimelineChart │ │ │ │ │ │ │ ├── TimelineChart.razor │ │ │ │ │ │ │ └── TimelineChart.razor.less │ │ │ │ │ │ ├── WaterWave │ │ │ │ │ │ │ ├── WaterWave.razor │ │ │ │ │ │ │ └── WaterWave.razor.less │ │ │ │ │ │ └── index.less │ │ │ │ │ ├── NumberInfo │ │ │ │ │ │ ├── NumberInfo.razor │ │ │ │ │ │ └── NumberInfo.razor.less │ │ │ │ │ ├── PageLoading │ │ │ │ │ │ └── PageLoading.razor │ │ │ │ │ ├── SaleItem.cs │ │ │ │ │ ├── SalesCard.razor │ │ │ │ │ ├── SalesCard.razor.cs │ │ │ │ │ └── Trend │ │ │ │ │ │ ├── Trend.razor │ │ │ │ │ │ ├── Trend.razor.cs │ │ │ │ │ │ └── Trend.razor.less │ │ │ │ ├── Index.razor │ │ │ │ └── Index.razor.less │ │ │ ├── Monitor │ │ │ │ ├── Components │ │ │ │ │ ├── ActiveChart │ │ │ │ │ │ ├── ActiveChart.razor │ │ │ │ │ │ └── ActiveChart.razor.less │ │ │ │ │ └── Charts │ │ │ │ │ │ ├── Gauge │ │ │ │ │ │ ├── Gauge.razor │ │ │ │ │ │ └── Gauge.razor.cs │ │ │ │ │ │ ├── Map │ │ │ │ │ │ ├── Map.razor │ │ │ │ │ │ └── MiniArea.razor │ │ │ │ │ │ ├── Pie │ │ │ │ │ │ ├── Pie.razor │ │ │ │ │ │ └── Pie.razor.cs │ │ │ │ │ │ ├── TagCloud │ │ │ │ │ │ ├── TagCloud.razor │ │ │ │ │ │ └── TagCloud.razor.cs │ │ │ │ │ │ └── WaterWave │ │ │ │ │ │ ├── WaterWave.razor │ │ │ │ │ │ └── WaterWave.razor.cs │ │ │ │ ├── Index.razor │ │ │ │ └── Index.razor.less │ │ │ └── Workplace │ │ │ │ ├── Components │ │ │ │ ├── EditableLinkGroup │ │ │ │ │ ├── EditableLinkGroup.razor │ │ │ │ │ ├── EditableLinkGroup.razor.cs │ │ │ │ │ └── EditableLinkGroup.razor.less │ │ │ │ └── Radar │ │ │ │ │ ├── AutoHeight.razor │ │ │ │ │ ├── Radar.razor │ │ │ │ │ └── Radar.razor.less │ │ │ │ ├── Index.razor │ │ │ │ ├── Index.razor.cs │ │ │ │ └── Index.razor.less │ │ ├── Exception │ │ │ ├── 403 │ │ │ │ └── 403.razor │ │ │ ├── 404 │ │ │ │ └── 404.razor │ │ │ └── 500 │ │ │ │ └── 500.razor │ │ ├── Form │ │ │ ├── AdvancedForm │ │ │ │ ├── AdvancedForm.razor │ │ │ │ ├── AdvancedForm.razor.cs │ │ │ │ └── AdvancedForm.razor.less │ │ │ ├── BasicForm │ │ │ │ ├── BasicForm.razor │ │ │ │ ├── BasicForm.razor.cs │ │ │ │ └── BasicForm.razor.less │ │ │ └── StepForm │ │ │ │ ├── Components │ │ │ │ ├── Step1 │ │ │ │ │ ├── Step1.razor │ │ │ │ │ ├── Step1.razor.cs │ │ │ │ │ └── Step1.razor.less │ │ │ │ ├── Step2 │ │ │ │ │ ├── Step2.razor │ │ │ │ │ ├── Step2.razor.cs │ │ │ │ │ └── Step2.razor.less │ │ │ │ └── Step3 │ │ │ │ │ ├── Step3.razor │ │ │ │ │ ├── Step3.razor.cs │ │ │ │ │ └── Step3.razor.less │ │ │ │ ├── StepForm.razor │ │ │ │ ├── StepForm.razor.cs │ │ │ │ └── StepForm.razor.less │ │ ├── List │ │ │ ├── BasicList │ │ │ │ ├── BasicList.razor │ │ │ │ ├── BasicList.razor.cs │ │ │ │ ├── BasicList.razor.less │ │ │ │ └── utils │ │ │ │ │ └── utils.less │ │ │ ├── CardList │ │ │ │ ├── CardList.razor │ │ │ │ ├── CardList.razor.cs │ │ │ │ ├── CardList.razor.less │ │ │ │ └── utils │ │ │ │ │ └── utils.less │ │ │ ├── Search │ │ │ │ ├── Applications │ │ │ │ │ ├── Applications.razor │ │ │ │ │ ├── Applications.razor.cs │ │ │ │ │ ├── Applications.razor.less │ │ │ │ │ ├── Components │ │ │ │ │ │ ├── StandardFormRow │ │ │ │ │ │ │ ├── StandardFormRow.razor │ │ │ │ │ │ │ ├── StandardFormRow.razor.cs │ │ │ │ │ │ │ └── StandardFormRow.razor.less │ │ │ │ │ │ └── TagSelect │ │ │ │ │ │ │ ├── TagSelect.razor │ │ │ │ │ │ │ ├── TagSelect.razor.cs │ │ │ │ │ │ │ ├── TagSelect.razor.less │ │ │ │ │ │ │ ├── TagSelectOption.razor │ │ │ │ │ │ │ └── TagSelectOption.razor.cs │ │ │ │ │ └── utils │ │ │ │ │ │ └── utils.less │ │ │ │ ├── Articles │ │ │ │ │ ├── Articles.razor │ │ │ │ │ ├── Articles.razor.cs │ │ │ │ │ └── Articles.razor.less │ │ │ │ ├── Projects │ │ │ │ │ ├── Projects.razor │ │ │ │ │ └── Projects.razor.cs │ │ │ │ ├── SearchList.razor │ │ │ │ └── SearchList.razor.cs │ │ │ └── TableList │ │ │ │ ├── TableList.razor │ │ │ │ └── TableList.razor.less │ │ ├── Profile │ │ │ ├── Advanced │ │ │ │ ├── Advanced.razor │ │ │ │ ├── Advanced.razor.cs │ │ │ │ └── Advanced.razor.less │ │ │ └── Basic │ │ │ │ ├── Basic.razor │ │ │ │ ├── Basic.razor.cs │ │ │ │ └── Basic.razor.less │ │ ├── Result │ │ │ ├── Fail │ │ │ │ ├── Fail.razor │ │ │ │ └── Fail.razor.less │ │ │ └── Success │ │ │ │ ├── Success.razor │ │ │ │ └── Success.razor.less │ │ └── User │ │ │ ├── Login │ │ │ ├── Login.razor │ │ │ ├── Login.razor.cs │ │ │ └── Login.razor.less │ │ │ ├── Register │ │ │ ├── Register.razor │ │ │ ├── Register.razor.cs │ │ │ └── Register.razor.less │ │ │ └── RegisterResult │ │ │ ├── RegisterResult.razor │ │ │ └── RegisterResult.razor.less │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── README.md │ ├── Services │ │ ├── AccountService.cs │ │ ├── ChartService.cs │ │ ├── ProfileService.cs │ │ ├── ProjectService.cs │ │ └── UserService.cs │ ├── Utils │ │ └── LongToDateTimeConverter.cs │ ├── _Imports.razor │ ├── gulpfile.js │ ├── package.json │ ├── styles │ │ └── global.less │ └── wwwroot │ │ ├── appsettings.json │ │ ├── assets │ │ ├── 403.svg │ │ └── logo.svg │ │ ├── css │ │ └── site.css │ │ ├── data │ │ ├── activities.json │ │ ├── advanced.json │ │ ├── basic.json │ │ ├── current_user.json │ │ ├── fake_chart_data.json │ │ ├── fake_list.json │ │ ├── menu.json │ │ ├── notice.json │ │ └── notices.json │ │ ├── favicon.ico │ │ ├── index.html │ │ └── pro_icon.svg ├── BlazorAppDemo │ ├── App.razor │ ├── BlazorAppDemo.csproj │ ├── Pages │ │ ├── Counter.razor │ │ ├── FetchData.razor │ │ └── Index.razor │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Shared │ │ ├── MainLayout.razor │ │ ├── MainLayout.razor.css │ │ ├── NavMenu.razor │ │ ├── NavMenu.razor.css │ │ └── SurveyPrompt.razor │ ├── _Imports.razor │ └── wwwroot │ │ ├── css │ │ ├── app.css │ │ ├── bootstrap │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ └── open-iconic │ │ │ ├── FONT-LICENSE │ │ │ ├── ICON-LICENSE │ │ │ ├── README.md │ │ │ └── font │ │ │ ├── css │ │ │ └── open-iconic-bootstrap.min.css │ │ │ └── fonts │ │ │ ├── open-iconic.eot │ │ │ ├── open-iconic.otf │ │ │ ├── open-iconic.svg │ │ │ ├── open-iconic.ttf │ │ │ └── open-iconic.woff │ │ ├── favicon.ico │ │ ├── index.html │ │ └── sample-data │ │ └── weather.json ├── DotNetConf2020Demo.sln ├── RecordDemo │ ├── .vscode │ │ ├── launch.json │ │ └── tasks.json │ ├── Program.cs │ └── RecordDemo.csproj ├── TopLevelStatements │ ├── Program.cs │ └── TopLevelStatements.csproj └── package-lock.json ├── DotNetConf2022Demo └── DotNetConf2022Demo │ ├── BulkUpdatesDemo │ ├── BulkUpdatesDbContext.cs │ ├── BulkUpdatesDemo.csproj │ ├── DbInitializer.cs │ ├── Models.cs │ └── Program.cs │ ├── CSharpDemo │ ├── .vscode │ │ ├── launch.json │ │ └── tasks.json │ ├── CSharpDemo.csproj │ ├── FileScope │ │ ├── File1.cs │ │ └── File2.cs │ ├── Program.cs │ ├── RequiredMember.cs │ └── StringInterpolation.cs │ ├── DotNetConf2022Demo.sln │ ├── JsonColumnsDemo │ ├── DbInitializer.cs │ ├── JsonColumnsDbContext.cs │ ├── JsonColumnsDemo.csproj │ ├── Models.cs │ └── Program.cs │ └── RateLimitingDemo │ ├── Controllers │ └── WeatherForecastController.cs │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ ├── RateLimitingDemo.csproj │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ └── appsettings.json ├── DotNetConf2023Demo └── SemanticKernelDemo │ ├── SemanticKernelDemo.sln │ └── SemanticKernelDemo │ ├── ChatbotV1 │ └── ChatbotDemoV1.cs │ ├── ChatbotV2 │ └── ChatbotDemoV2.cs │ ├── ChatbotV3 │ ├── ChatbotDemoV3.cs │ ├── Plugins │ │ ├── SummarizePlugin │ │ │ ├── MakeAbstractReadable │ │ │ │ ├── config.json │ │ │ │ └── skprompt.txt │ │ │ ├── Notegen │ │ │ │ ├── config.json │ │ │ │ └── skprompt.txt │ │ │ ├── Summarize │ │ │ │ ├── config.json │ │ │ │ └── skprompt.txt │ │ │ └── Topics │ │ │ │ ├── config.json │ │ │ │ └── skprompt.txt │ │ └── WriterPlugin │ │ │ ├── Acronym │ │ │ ├── config.json │ │ │ └── skprompt.txt │ │ │ ├── AcronymGenerator │ │ │ ├── config.json │ │ │ └── skprompt.txt │ │ │ ├── AcronymReverse │ │ │ ├── config.json │ │ │ └── skprompt.txt │ │ │ ├── Brainstorm │ │ │ ├── config.json │ │ │ └── skprompt.txt │ │ │ ├── EmailGen │ │ │ ├── config.json │ │ │ └── skprompt.txt │ │ │ ├── EmailTo │ │ │ ├── config.json │ │ │ └── skprompt.txt │ │ │ ├── EnglishImprover │ │ │ ├── config.json │ │ │ └── skprompt.txt │ │ │ ├── NovelChapter │ │ │ ├── config.json │ │ │ └── skprompt.txt │ │ │ ├── NovelChapterWithNotes │ │ │ ├── config.json │ │ │ └── skprompt.txt │ │ │ ├── NovelOutline │ │ │ ├── config.json │ │ │ └── skprompt.txt │ │ │ ├── Rewrite │ │ │ ├── config.json │ │ │ └── skprompt.txt │ │ │ ├── ShortPoem │ │ │ ├── config.json │ │ │ └── skprompt.txt │ │ │ ├── StoryGen │ │ │ ├── config.json │ │ │ └── skprompt.txt │ │ │ ├── TellMeMore │ │ │ ├── config.json │ │ │ └── skprompt.txt │ │ │ ├── Translate │ │ │ ├── config.json │ │ │ └── skprompt.txt │ │ │ └── TwoSentenceSummary │ │ │ ├── config.json │ │ │ └── skprompt.txt │ └── Utils.cs │ ├── Config │ ├── Settings.cs │ └── settings.json │ ├── EmailWriter │ ├── AuthorEmailPlanner.cs │ ├── ChatbotDemoV4.cs │ └── EmailPlugin.cs │ ├── Program.cs │ └── SemanticKernelDemo.csproj ├── GlobalAIBootcamp2025Demo ├── Demo1 │ ├── ChatDemo.cs │ ├── Demo1.csproj │ ├── Program.cs │ └── appsettings.json ├── Demo2 │ ├── ChatDemo.cs │ ├── Demo2.csproj │ ├── InvoiceSearchBy.cs │ ├── Program.cs │ └── appsettings.json ├── Demo3 │ ├── ChatDemo.cs │ ├── Demo3.csproj │ ├── Program.cs │ └── appsettings.json ├── Demo4 │ ├── ChatDemo.cs │ ├── Demo4.csproj │ ├── Program.cs │ ├── Sample.txt │ └── appsettings.json ├── Demo6 │ ├── Demo6.csproj │ ├── EchoTool.cs │ ├── Program.cs │ ├── TodoService.cs │ └── TodoTools.cs ├── GlobalAIBootcamp2025Demo.sln └── Shared │ ├── BingSearchOptions.cs │ ├── Helpers.cs │ ├── OpenAiOptions.cs │ └── Shared.csproj ├── LICENSE ├── LlmDemos ├── ChatDemoV1 │ ├── ChatDemo.cs │ ├── ChatDemoV1.csproj │ ├── Program.cs │ └── appsettings.json ├── ChatDemoV2 │ ├── ChatDemo.cs │ ├── ChatDemoV2.csproj │ ├── Program.cs │ └── appsettings.json ├── ChatDemoV3 │ ├── ChatDemo.cs │ ├── ChatDemoV3.csproj │ ├── Program.cs │ └── appsettings.json ├── ChatDemoV4 │ ├── ChatDemo.cs │ ├── ChatDemoV4.csproj │ ├── Program.cs │ └── appsettings.json ├── ChatDemoV5 │ ├── ChatDemo.cs │ ├── ChatDemoV5.csproj │ ├── Program.cs │ └── appsettings.json ├── ChatDemoV6 │ ├── ChatDemo.cs │ ├── ChatDemoV6.csproj │ ├── Program.cs │ ├── SampleOutput.md │ └── appsettings.json ├── LlmDemos.sln └── Shared │ ├── BingSearchOptions.cs │ ├── Helpers.cs │ ├── OpenAiOptions.cs │ └── Shared.csproj ├── OpenAILab2023 ├── How-to-OpenAI.md ├── README.md └── sk-demo │ └── SemanticKernelDemo │ ├── SemanticKernelDemo.App │ ├── 1.CreatingKernel.cs │ ├── 2.LoadPluginFromFiles.cs │ ├── 3.LoadPluginFromInline.cs │ ├── 4.SetContextVariables.cs │ ├── 5.UsePlanner.cs │ ├── Plugins │ │ ├── FunSkill │ │ │ ├── Excuses │ │ │ │ ├── config.json │ │ │ │ └── skprompt.txt │ │ │ ├── Joke │ │ │ │ ├── config.json │ │ │ │ └── skprompt.txt │ │ │ └── Limerick │ │ │ │ ├── config.json │ │ │ │ └── skprompt.txt │ │ ├── SummarizeSkill │ │ │ ├── MakeAbstractReadable │ │ │ │ ├── config.json │ │ │ │ └── skprompt.txt │ │ │ ├── Notegen │ │ │ │ ├── config.json │ │ │ │ └── skprompt.txt │ │ │ ├── Summarize │ │ │ │ ├── config.json │ │ │ │ └── skprompt.txt │ │ │ └── Topics │ │ │ │ ├── config.json │ │ │ │ └── skprompt.txt │ │ └── WriterSkill │ │ │ ├── Acronym │ │ │ ├── config.json │ │ │ └── skprompt.txt │ │ │ ├── AcronymGenerator │ │ │ ├── config.json │ │ │ └── skprompt.txt │ │ │ ├── AcronymReverse │ │ │ ├── config.json │ │ │ └── skprompt.txt │ │ │ ├── Brainstorm │ │ │ ├── config.json │ │ │ └── skprompt.txt │ │ │ ├── EmailGen │ │ │ ├── config.json │ │ │ └── skprompt.txt │ │ │ ├── EmailTo │ │ │ ├── config.json │ │ │ └── skprompt.txt │ │ │ ├── EnglishImprover │ │ │ ├── config.json │ │ │ └── skprompt.txt │ │ │ ├── NovelChapter │ │ │ ├── config.json │ │ │ └── skprompt.txt │ │ │ ├── NovelChapterWithNotes │ │ │ ├── config.json │ │ │ └── skprompt.txt │ │ │ ├── NovelOutline │ │ │ ├── config.json │ │ │ └── skprompt.txt │ │ │ ├── Rewrite │ │ │ ├── config.json │ │ │ └── skprompt.txt │ │ │ ├── ShortPoem │ │ │ ├── config.json │ │ │ └── skprompt.txt │ │ │ ├── StoryGen │ │ │ ├── config.json │ │ │ └── skprompt.txt │ │ │ ├── TellMeMore │ │ │ ├── config.json │ │ │ └── skprompt.txt │ │ │ ├── Translate │ │ │ ├── config.json │ │ │ └── skprompt.txt │ │ │ └── TwoSentenceSummary │ │ │ ├── config.json │ │ │ └── skprompt.txt │ ├── Program.cs │ ├── SemanticKernelDemo.App.csproj │ ├── Settings.cs │ ├── Utils.cs │ └── config │ │ └── settings.json │ └── SemanticKernelDemo.sln ├── README.md ├── SeasonOfAICopilot └── PodcastAppAPI │ ├── PodcastAppAPI.sln │ └── PodcastAppAPI │ ├── .config │ └── dotnet-tools.json │ ├── AppConfigurationOptions.cs │ ├── IPodcastCopilot.cs │ ├── PodcastAppAPI.csproj │ ├── PodcastAppAPI.http │ ├── PodcastCopilot.cs │ ├── Program.cs │ ├── Properties │ ├── launchSettings.json │ ├── serviceDependencies.json │ └── serviceDependencies.local.json │ ├── SocialMediaPost.cs │ ├── appsettings.Development.json │ └── appsettings.json ├── SeasonOfAIDemo └── SeasonOfAIDemo │ ├── AutoGenDemo │ ├── AutoGenDemo.csproj │ ├── ChatWithAssistantAgent.cs │ ├── ChatWithSemanticKernelAgent.cs │ ├── Helpers.cs │ ├── OpenAiOptions.cs │ ├── Program.cs │ └── appsettings.json │ ├── SeasonOfAIDemo.sln │ └── SeasonOfAIDemo │ ├── ChatV1 │ └── ChatDemoV1.cs │ ├── ChatV2 │ └── ChatDemoV2.cs │ ├── ChatV3 │ └── ChatDemoV3.cs │ ├── ChatV4 │ └── ChatDemoV4.cs │ ├── Helpers.cs │ ├── OpenAiOptions.cs │ ├── Program.cs │ ├── SeasonOfAIDemo.csproj │ └── appsettings.json └── WebApiClientDemo └── WebApiClientDemo ├── WebApiClientDemo.Client ├── IWebApiClient.cs ├── WebApiClient.cs ├── WebApiClientDemo.Client.csproj ├── WebApiClientExtensions.cs ├── WebApiClientOptions.cs └── nswag.json ├── WebApiClientDemo.sln └── WebApiClientDemo ├── .config └── dotnet-tools.json ├── Controllers ├── ProductsController.cs └── WeatherForecastController.cs ├── Program.cs ├── Properties └── launchSettings.json ├── WeatherForecast.cs ├── WebApiClientDemo.csproj ├── WebApiClientDemo.http ├── appsettings.Development.json ├── appsettings.json └── openapi.json /BuildVersionDemo/BuildVersionDemo/BuildVersionDemo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | False 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /BuildVersionDemo/BuildVersionDemo/Controllers/AppInfoController.cs: -------------------------------------------------------------------------------- 1 | using BuildVersionDemo.Models; 2 | using Microsoft.AspNetCore.Mvc; 3 | using System.Reflection; 4 | 5 | namespace BuildVersionDemo.Controllers 6 | { 7 | [Route("api/[controller]")] 8 | [ApiController] 9 | public class AppInfoController : ControllerBase 10 | { 11 | [HttpGet(Name = "GetAppInfo")] 12 | public AppInfo Get() 13 | { 14 | return new AppInfo() 15 | { 16 | Version = Assembly.GetEntryAssembly()?.GetName().Version?.ToString() ?? "1.0.0" 17 | }; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /BuildVersionDemo/BuildVersionDemo/Models/AppInfo.cs: -------------------------------------------------------------------------------- 1 | namespace BuildVersionDemo.Models 2 | { 3 | public class AppInfo 4 | { 5 | public string Name { get; set; } = "BuildVersionDemo"; 6 | public string Version { get; set; } = string.Empty; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /BuildVersionDemo/BuildVersionDemo/Program.cs: -------------------------------------------------------------------------------- 1 | var builder = WebApplication.CreateBuilder(args); 2 | 3 | // Add services to the container. 4 | 5 | builder.Services.AddControllers(); 6 | // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle 7 | builder.Services.AddEndpointsApiExplorer(); 8 | builder.Services.AddSwaggerGen(); 9 | 10 | var app = builder.Build(); 11 | 12 | // Configure the HTTP request pipeline. 13 | if (app.Environment.IsDevelopment()) 14 | { 15 | app.UseSwagger(); 16 | app.UseSwaggerUI(); 17 | } 18 | 19 | app.UseAuthorization(); 20 | 21 | app.MapControllers(); 22 | 23 | app.Run(); 24 | -------------------------------------------------------------------------------- /BuildVersionDemo/BuildVersionDemo/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:57226", 8 | "sslPort": 0 9 | } 10 | }, 11 | "profiles": { 12 | "BuildVersionDemo": { 13 | "commandName": "Project", 14 | "dotnetRunMessages": true, 15 | "launchBrowser": true, 16 | "launchUrl": "swagger", 17 | "applicationUrl": "http://localhost:5261", 18 | "environmentVariables": { 19 | "ASPNETCORE_ENVIRONMENT": "Development" 20 | } 21 | }, 22 | "IIS Express": { 23 | "commandName": "IISExpress", 24 | "launchBrowser": true, 25 | "launchUrl": "swagger", 26 | "environmentVariables": { 27 | "ASPNETCORE_ENVIRONMENT": "Development" 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /BuildVersionDemo/BuildVersionDemo/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace BuildVersionDemo 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime 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 | } -------------------------------------------------------------------------------- /BuildVersionDemo/BuildVersionDemo/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /BuildVersionDemo/BuildVersionDemo/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /Chatbot/Chatbot/Chatbot.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Chatbot/Chatbot/Program.cs: -------------------------------------------------------------------------------- 1 | // See https://aka.ms/new-console-template for more information 2 | 3 | using Azure; 4 | using Azure.AI.OpenAI; 5 | using Chatbot; 6 | using System.Text; 7 | 8 | Console.InputEncoding = Encoding.Unicode; 9 | Console.OutputEncoding = Encoding.Unicode; 10 | 11 | 12 | var openAiClient = new OpenAIClient(new Uri("YOUR_API_ENDPOINT"), new AzureKeyCredential("YOUR_API_KEY")); 13 | 14 | Console.Write(@"Do you want to enable voice input/output? y for yes, n for no."); 15 | var enableVoice = false; 16 | var enableVoiceInputOutput = Console.ReadLine(); 17 | if (enableVoiceInputOutput?.Trim().ToLower() == "y") 18 | { 19 | Console.WriteLine("Voice input/output enabled. Press r to talk or type your message."); 20 | enableVoice = true; 21 | } 22 | else 23 | { 24 | Console.WriteLine("Voice input/output disabled."); 25 | } 26 | 27 | if (enableVoice) 28 | { 29 | await VoiceChatbot.Chat(openAiClient); 30 | } 31 | else 32 | { 33 | await TextChatbot.Chat(openAiClient); 34 | } -------------------------------------------------------------------------------- /CodeCampWellington2024Demo/CodeCampWellington2024/CodeCampWellington2024/OpenAiOptions.cs: -------------------------------------------------------------------------------- 1 | namespace CodeCampWellington2024; 2 | internal sealed class OpenAiOptions 3 | { 4 | public string Model { get; set; } = string.Empty; 5 | public string Endpoint { get; set; } = string.Empty; 6 | public string Key { get; set; } = string.Empty; 7 | } 8 | 9 | internal sealed class BingSearchOptions 10 | { 11 | public string Endpoint { get; set; } = string.Empty; 12 | public string Key { get; set; } = string.Empty; 13 | } 14 | 15 | internal sealed class AzureAiSearchOptions 16 | { 17 | public string Endpoint { get; set; } = string.Empty; 18 | public string Key { get; set; } = string.Empty; 19 | public string Index { get; set; } = string.Empty; 20 | } -------------------------------------------------------------------------------- /CodeCampWellington2024Demo/CodeCampWellington2024/CodeCampWellington2024/Program.cs: -------------------------------------------------------------------------------- 1 | // See https://aka.ms/new-console-template for more information 2 | 3 | using CodeCampWellington2024; 4 | using CodeCampWellington2024.ChatV4; 5 | using Microsoft.Extensions.Configuration; 6 | using Microsoft.Extensions.Hosting; 7 | 8 | Console.WriteLine("Hello, Global Azure Day 2024!"); 9 | 10 | var builder = Host.CreateApplicationBuilder(args); 11 | builder.Configuration 12 | .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) 13 | .AddUserSecrets(); 14 | 15 | var (openAiOptions, bingSearchOptions, azureAiSearchOptions) = Helpers.GetConfigurations(builder); 16 | 17 | using IHost host = builder.Build(); 18 | 19 | // Application code should start here. 20 | 21 | //await ChatDemoV1.Run(openAiOptions); 22 | //await ChatDemoV2.Run(openAiOptions); 23 | //await ChatDemoV3.Run(openAiOptions, bingSearchOptions); 24 | await ChatDemoV4.Run(openAiOptions, azureAiSearchOptions); 25 | 26 | await host.RunAsync(); 27 | 28 | -------------------------------------------------------------------------------- /CodeCampWellington2024Demo/CodeCampWellington2024/CodeCampWellington2024/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "OpenAiOptions": { 3 | "Model": "", 4 | "Endpoint": "", 5 | "Key": "" 6 | }, 7 | "BingSearchOptions": { 8 | "Endpoint": "", 9 | "Key": "" 10 | }, 11 | "AzureAiSearchOptions": { 12 | "Endpoint": "", 13 | "Key": "", 14 | "Index": "" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /CodeGeneratorDemo/CodeGeneratorDemo.Client/CodeGeneratorDemo.Client.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | Exe 4 | net6.0 5 | true 6 | $(BaseIntermediateOutputPath)\GeneratedFiles 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /CodeGeneratorDemo/CodeGeneratorDemo.Client/Core/DIContainerMocker.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CodeGeneratorDemo.Client.Core 4 | { 5 | public static class DiContainerMocker 6 | { 7 | public static void RegisterService(TImplementation service) 8 | { 9 | Console.WriteLine($"{service.GetType()} has been registered for {typeof(TInterface)}."); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /CodeGeneratorDemo/CodeGeneratorDemo.Client/Core/IOrderService.cs: -------------------------------------------------------------------------------- 1 | namespace CodeGeneratorDemo.Client.Core 2 | { 3 | public interface IOrderService 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /CodeGeneratorDemo/CodeGeneratorDemo.Client/Core/IProductService.cs: -------------------------------------------------------------------------------- 1 | namespace CodeGeneratorDemo.Client.Core 2 | { 3 | public interface IProductService 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /CodeGeneratorDemo/CodeGeneratorDemo.Client/Core/OrderService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using CodeGeneratorDemo.SourceGeneratorDemo; 3 | 4 | namespace CodeGeneratorDemo.Client.Core 5 | { 6 | [AutoRegister] 7 | public class OrderService : IOrderService 8 | { 9 | public OrderService() 10 | { 11 | Console.WriteLine($"{this.GetType()} constructed."); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /CodeGeneratorDemo/CodeGeneratorDemo.Client/Core/ProductService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using CodeGeneratorDemo.SourceGeneratorDemo; 3 | 4 | namespace CodeGeneratorDemo.Client.Core 5 | { 6 | [AutoRegister] 7 | public class ProductService : IProductService 8 | { 9 | public ProductService() 10 | { 11 | Console.WriteLine($"{this.GetType()} constructed."); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /CodeGeneratorDemo/CodeGeneratorDemo.CodeSnippetsDemo/CodeGeneratorDemo.CodeSnippetsDemo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | false 9 | 10 | 11 | 12 | 13 | 14 | 15 | runtime; build; native; contentfiles; analyzers; buildtransitive 16 | all 17 | 18 | 19 | runtime; build; native; contentfiles; analyzers; buildtransitive 20 | all 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /CodeGeneratorDemo/CodeGeneratorDemo.CodeSnippetsDemo/UnitTest1.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Runtime.CompilerServices; 3 | using Xunit.Sdk; 4 | 5 | namespace CodeGeneratorDemo.CodeSnippetsDemo 6 | { 7 | public class UnitTest1 8 | { 9 | [Fact] 10 | public void Test1() 11 | { 12 | 13 | } 14 | 15 | [Theory] 16 | [InlineData(1)] 17 | public void Test2(int value) 18 | { 19 | 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /CodeGeneratorDemo/CodeGeneratorDemo.CodeSnippetsDemo/Usings.cs: -------------------------------------------------------------------------------- 1 | global using Xunit; -------------------------------------------------------------------------------- /CodeGeneratorDemo/CodeGeneratorDemo.ReflectionDemo.Core/ChineseSpeaker.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CodeGeneratorDemo.ReflectionDemo.Core 4 | { 5 | public class ChineseSpeaker : ISpeaker 6 | { 7 | public string Name => this.GetType().ToString(); 8 | 9 | public void SayHello() 10 | { 11 | Console.WriteLine("Nihao!"); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /CodeGeneratorDemo/CodeGeneratorDemo.ReflectionDemo.Core/CodeGeneratorDemo.ReflectionDemo.Core.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net6.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /CodeGeneratorDemo/CodeGeneratorDemo.ReflectionDemo.Core/EnglishSpeaker.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CodeGeneratorDemo.ReflectionDemo.Core 4 | { 5 | public class EnglishSpeaker : ISpeaker 6 | { 7 | public string Name => this.GetType().ToString(); 8 | 9 | public void SayHello() 10 | { 11 | Console.WriteLine("Hello!"); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /CodeGeneratorDemo/CodeGeneratorDemo.ReflectionDemo.Core/ISpeaker.cs: -------------------------------------------------------------------------------- 1 | namespace CodeGeneratorDemo.ReflectionDemo.Core 2 | { 3 | public interface ISpeaker 4 | { 5 | string Name { get;} 6 | void SayHello(); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /CodeGeneratorDemo/CodeGeneratorDemo.ReflectionDemo/CodeGeneratorDemo.ReflectionDemo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net6.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /CodeGeneratorDemo/CodeGeneratorDemo.SourceGeneratorDemo/CodeGeneratorDemo.SourceGeneratorDemo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | true 6 | $(BaseIntermediateOutputPath)\GeneratedFiles 7 | 8 | 9 | 10 | 11 | 12 | all 13 | runtime; build; native; contentfiles; analyzers; buildtransitive 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /CodeGeneratorDemo/CodeGeneratorDemo.T4TemplateDemo/RunTimeTextTemplateDemo.tt: -------------------------------------------------------------------------------- 1 | <#@ template language="C#" #> 2 | <#@ assembly name="System.Core" #> 3 | <#@ import namespace="System.Linq" #> 4 | <#@ import namespace="System.Text" #> 5 | <#@ import namespace="System.Collections.Generic" #> 6 | 7 |

Sales for Previous Month

8 | 9 | <# for (int i = 1; i <= 5; i++) 10 | { #> 11 | 12 | 13 | <# } #> 14 |
Test name <#= i #> Test value <#= i * i #>
15 | This report is Company Confidential. 16 | -------------------------------------------------------------------------------- /CodeGeneratorDemo/CodeGeneratorDemo.T4TemplateDemo/dataSource.txt: -------------------------------------------------------------------------------- 1 | Product,Category,Comment,Order -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/App.razor: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Sorry, there's nothing at this address.

8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Layouts/BasicLayout.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesignBlazorDemo 2 | @inherits LayoutComponentBase 3 | 4 | 7 | 8 | 9 | 10 | 11 | @Body 12 | 13 | 14 | 15 | 16 | @code 17 | { 18 | private MenuDataItem[] _menuData = {}; 19 | 20 | [Inject] public HttpClient HttpClient { get; set; } 21 | 22 | protected override async Task OnInitializedAsync() 23 | { 24 | await base.OnInitializedAsync(); 25 | _menuData = await HttpClient.GetFromJsonAsync("data/menu.json"); 26 | } 27 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Models/ActivitiesType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace AntDesignBlazorDemo.Models 4 | { 5 | public class ActivitiesType 6 | { 7 | public string Id { get; set; } 8 | public DateTime UpdatedAt { get; set; } 9 | public ActivityUser User { get; set; } 10 | public ActivityGroup Group { get; set; } 11 | public ActivityProject Project { get; set; } 12 | public string Template { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Models/ActivityGroup.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesignBlazorDemo.Models 2 | { 3 | public class ActivityGroup 4 | { 5 | public string Name { get; set; } 6 | public string Link { get; set; } 7 | } 8 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Models/ActivityProject.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesignBlazorDemo.Models 2 | { 3 | public class ActivityProject 4 | { 5 | public string Name { get; set; } 6 | public string Link { get; set; } 7 | } 8 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Models/ActivityUser.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesignBlazorDemo.Models 2 | { 3 | public class ActivityUser 4 | { 5 | public string Name { get; set; } 6 | public string Avatar { get; set; } 7 | } 8 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Models/AdvancedOperation.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesignBlazorDemo.Models 2 | { 3 | public class AdvancedOperation 4 | { 5 | public string Key { get; set; } 6 | public string Type { get; set; } 7 | public string Name { get; set; } 8 | public string Status { get; set; } 9 | public string UpdatedAt { get; set; } 10 | public string Memo { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Models/AdvancedProfileData.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesignBlazorDemo.Models 2 | { 3 | public class AdvancedProfileData 4 | { 5 | public AdvancedOperation[] AdvancedOperation1 { get; set; } 6 | public AdvancedOperation[] AdvancedOperation2 { get; set; } 7 | public AdvancedOperation[] AdvancedOperation3 { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Models/BasicGood.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesignBlazorDemo.Models 2 | { 3 | public class BasicGood 4 | { 5 | public string Id { get; set; } 6 | public string Name { get; set; } 7 | public string Barcode { get; set; } 8 | public string Price { get; set; } 9 | public string Num { get; set; } 10 | public string Amount { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Models/BasicProfileDataType.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesignBlazorDemo.Models 2 | { 3 | public class BasicProfileDataType 4 | { 5 | public BasicGood[] BasicGoods { get; set; } 6 | public BasicProgress[] BasicProgress { get; set; } 7 | } 8 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Models/BasicProgress.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesignBlazorDemo.Models 2 | { 3 | public class BasicProgress 4 | { 5 | public string Key { get; set; } 6 | public string Time { get; set; } 7 | public string Rate { get; set; } 8 | public string Status { get; set; } 9 | public string Operator { get; set; } 10 | public string Cost { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Models/ChartData.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesignBlazorDemo.Models 2 | { 3 | public class ChartData 4 | { 5 | public ChartDataItem[] VisitData { get; set; } 6 | public ChartDataItem[] VisitData2 { get; set; } 7 | public ChartDataItem[] SalesData { get; set; } 8 | public SearchDataItem[] SearchData { get; set; } 9 | public OfflineDataItem[] OfflineData { get; set; } 10 | public OfflineChartDataItem[] OfflineChartData { get; set; } 11 | public ChartDataItem[] SalesTypeData { get; set; } 12 | public ChartDataItem[] SalesTypeDataOnline { get; set; } 13 | public ChartDataItem[] SalesTypeDataOffline { get; set; } 14 | public RadarDataItem[] RadarData { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Models/ChartDataItem.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesignBlazorDemo.Models 2 | { 3 | public class ChartDataItem 4 | { 5 | public string X { get; set; } 6 | public int Y { get; set; } 7 | } 8 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Models/ListFormModel.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesignBlazorDemo.Models 2 | { 3 | public class ListFormModel 4 | { 5 | public string Owner { get; set; } = "wzj"; 6 | 7 | public string ActiveUser { get; set; } 8 | 9 | public string Satisfaction { get; set; } 10 | } 11 | 12 | public class BasicListFormModel 13 | { 14 | public string Status { get; set; } = "all"; 15 | public string SearchKeyword { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Models/LoginParamsType.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace AntDesignBlazorDemo.Models 4 | { 5 | public class LoginParamsType 6 | { 7 | [Required] public string UserName { get; set; } 8 | 9 | [Required] public string Password { get; set; } 10 | 11 | public string Mobile { get; set; } 12 | 13 | public string Captcha { get; set; } 14 | 15 | public string LoginType { get; set; } 16 | 17 | public bool AutoLogin { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Models/NoticeItem.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Pro.Layout; 2 | 3 | namespace AntDesignBlazorDemo.Models 4 | { 5 | public class NoticeItem : NoticeIconData 6 | { 7 | public string Id { get; set; } 8 | public string Type { get; set; } 9 | public string Status { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Models/NoticeType.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesignBlazorDemo.Models 2 | { 3 | public class NoticeType 4 | { 5 | public string Id { get; set; } 6 | public string Title { get; set; } 7 | public string Logo { get; set; } 8 | public string Description { get; set; } 9 | public string UpdatedAt { get; set; } 10 | public string Member { get; set; } 11 | public string Href { get; set; } 12 | public string MemberLink { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Models/OfflineChartDataItem.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesignBlazorDemo.Models 2 | { 3 | public class OfflineChartDataItem 4 | { 5 | public long X { get; set; } 6 | public int Y1 { get; set; } 7 | public int Y2 { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Models/OfflineDataItem.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesignBlazorDemo.Models 2 | { 3 | public class OfflineDataItem 4 | { 5 | public string Name { get; set; } 6 | public float Cvr { get; set; } 7 | } 8 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Models/RadarDataItem.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesignBlazorDemo.Models 2 | { 3 | public class RadarDataItem 4 | { 5 | public string Name { get; set; } 6 | public string Label { get; set; } 7 | public int Value { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Models/SearchDataItem.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesignBlazorDemo.Models 2 | { 3 | public class SearchDataItem 4 | { 5 | public int Index { get; set; } 6 | public string Keywod { get; set; } 7 | public int Count { get; set; } 8 | public int Range { get; set; } 9 | public int Status { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Account/Center/Components/Applications/Applications.razor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using AntDesignBlazorDemo.Models; 3 | using Microsoft.AspNetCore.Components; 4 | using AntDesign; 5 | 6 | namespace AntDesignBlazorDemo.Pages.Account.Center 7 | { 8 | public partial class Applications 9 | { 10 | private readonly ListGridType _listGridType = new ListGridType 11 | { 12 | Gutter = 24, 13 | Column = 4 14 | }; 15 | 16 | [Parameter] public IList List { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Account/Center/Components/ArticleListContent/ArticleListContent.razor: -------------------------------------------------------------------------------- 1 | @using AntDesignBlazorDemo.Models 2 | @namespace AntDesignBlazorDemo.Pages.Account.Center 3 | 4 |
5 |
@Data.Content
6 |
7 | 8 | @Data.Owner 发布在 @Data.Href 9 | @Data.UpdatedAt.ToString("yyyy-MM-dd HH:mm:ss") 10 |
11 |
12 | 13 | @code 14 | { 15 | [Parameter] public ListItemDataType Data { get; set; } 16 | } 17 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Account/Center/Components/ArticleListContent/ArticleListContent.razor.less: -------------------------------------------------------------------------------- 1 | @import '~antd/es/style/themes/default.less'; 2 | 3 | .listContent { 4 | .description { 5 | max-width: 720px; 6 | line-height: 22px; 7 | } 8 | .extra { 9 | margin-top: 16px; 10 | color: @text-color-secondary; 11 | line-height: 22px; 12 | & > :global(.ant-avatar) { 13 | position: relative; 14 | top: 1px; 15 | width: 20px; 16 | height: 20px; 17 | margin-right: 8px; 18 | vertical-align: top; 19 | } 20 | & > em { 21 | margin-left: 16px; 22 | color: @disabled-color; 23 | font-style: normal; 24 | } 25 | } 26 | } 27 | 28 | @media screen and (max-width: @screen-xs) { 29 | .listContent { 30 | .extra { 31 | & > em { 32 | display: block; 33 | margin-top: 8px; 34 | margin-left: 0; 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Account/Center/Components/Articles/Articles.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesignBlazorDemo.Pages.Account.Center 2 | 3 | 8 | 9 | 10 | 11 | @context.Title 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Account/Center/Components/Articles/Articles.razor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using AntDesignBlazorDemo.Models; 3 | using Microsoft.AspNetCore.Components; 4 | 5 | namespace AntDesignBlazorDemo.Pages.Account.Center 6 | { 7 | public partial class Articles 8 | { 9 | [Parameter] public IList List { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Account/Center/Components/Articles/Articles.razor.less: -------------------------------------------------------------------------------- 1 | @import '~antd/es/style/themes/default.less'; 2 | 3 | .articleList { 4 | :global { 5 | .ant-list-item:first-child { 6 | padding-top: 0; 7 | } 8 | } 9 | } 10 | a.listItemMetaTitle { 11 | color: @heading-color; 12 | } 13 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Account/Center/Components/AvatarList/AvatarList.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesignBlazorDemo.Pages.Account.Center 2 | 3 |
4 |
    5 | @ChildContent 6 |
7 |
-------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Account/Center/Components/AvatarList/AvatarList.razor.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components; 2 | 3 | namespace AntDesignBlazorDemo.Pages.Account.Center 4 | { 5 | public partial class AvatarList 6 | { 7 | [Parameter] public RenderFragment ChildContent { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Account/Center/Components/AvatarList/AvatarListItem.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesignBlazorDemo.Pages.Account.Center 2 | @inherits AntDomComponentBase 3 | 4 |
  • 5 | @if (string.IsNullOrEmpty(Tips)) 6 | { 7 | 8 | 9 | 10 | } 11 | else 12 | { 13 | 14 | } 15 |
  • -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Account/Center/Components/AvatarList/AvatarListItem.razor.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components; 2 | 3 | namespace AntDesignBlazorDemo.Pages.Account.Center 4 | { 5 | public partial class AvatarListItem 6 | { 7 | [Parameter] public string Size { get; set; } 8 | [Parameter] public string Tips { get; set; } 9 | [Parameter] public string Src { get; set; } 10 | [Parameter] public EventCallback OnClick { get; set; } 11 | 12 | protected override void OnInitialized() 13 | { 14 | base.OnInitialized(); 15 | SetClassMap(); 16 | } 17 | 18 | protected void SetClassMap() 19 | { 20 | ClassMapper 21 | .Clear() 22 | .Add("avatarItem") 23 | .If("avatarItemLarge", () => Size == "large") 24 | .If("avatarItemSmall", () => Size == "small") 25 | .If("avatarItemMini", () => Size == "mini"); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Account/Center/Components/Projects/Projects.razor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using AntDesignBlazorDemo.Models; 3 | using Microsoft.AspNetCore.Components; 4 | using AntDesign; 5 | 6 | namespace AntDesignBlazorDemo.Pages.Account.Center 7 | { 8 | public partial class Projects 9 | { 10 | private readonly ListGridType _listGridType = new ListGridType 11 | { 12 | Gutter = 24, 13 | Column = 4 14 | }; 15 | 16 | [Parameter] 17 | public IList List { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Account/Settings/Components/BaseView.razor.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using AntDesignBlazorDemo.Models; 3 | using AntDesignBlazorDemo.Services; 4 | using Microsoft.AspNetCore.Components; 5 | 6 | namespace AntDesignBlazorDemo.Pages.Account.Settings 7 | { 8 | public partial class BaseView 9 | { 10 | private CurrentUser _currentUser = new CurrentUser(); 11 | 12 | [Inject] protected IUserService UserService { get; set; } 13 | 14 | private void HandleFinish() 15 | { 16 | } 17 | 18 | protected override async Task OnInitializedAsync() 19 | { 20 | await base.OnInitializedAsync(); 21 | _currentUser = await UserService.GetCurrentUserAsync(); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Account/Settings/Components/BindingView.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesignBlazorDemo.Pages.Account.Settings 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | @code 17 | { 18 | private static RenderFragment _modify = @Bind; 19 | 20 | private readonly RenderFragment[] _actions = {_modify}; 21 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Account/Settings/Components/BindingView.razor.cs: -------------------------------------------------------------------------------- 1 | using AntDesignBlazorDemo.Models; 2 | 3 | namespace AntDesignBlazorDemo.Pages.Account.Settings 4 | { 5 | public partial class BindingView 6 | { 7 | private readonly UserLiteItem[] _data = 8 | { 9 | new UserLiteItem 10 | { 11 | Avater = "taobao", 12 | Title = "Binding Taobao", 13 | Description = "Currently unbound Taobao account" 14 | }, 15 | new UserLiteItem 16 | { 17 | Avater = "alipay", 18 | Title = "Binding Alipay", 19 | Description = "Currently unbound Alipay account" 20 | }, 21 | new UserLiteItem 22 | { 23 | Avater = "dingding", 24 | Title = "Binding DingTalk", 25 | Description = "Currently unbound DingTalk account" 26 | } 27 | }; 28 | } 29 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Account/Settings/Components/GeographicView.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesignBlazorDemo.Pages.Account.Settings 2 | 3 |

    4 | GeographicView 5 |

    -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Account/Settings/Components/GeographicView.razor.less: -------------------------------------------------------------------------------- 1 | @import '~antd/es/style/themes/default.less'; 2 | 3 | .row { 4 | .item { 5 | width: 50%; 6 | max-width: 220px; 7 | } 8 | .item:first-child { 9 | width: ~'calc(50% - 8px)'; 10 | margin-right: 8px; 11 | } 12 | } 13 | 14 | @media screen and (max-width: @screen-sm) { 15 | .item:first-child { 16 | margin: 0; 17 | margin-bottom: 8px; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Account/Settings/Components/NotificationView.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesignBlazorDemo.Pages.Account.Settings 2 | 3 | 7 | 8 | 9 | @context.Title 10 | 11 | 12 | 13 | 14 | @code 15 | { 16 | private static RenderFragment _switch = @; 17 | private readonly RenderFragment[] _actions = {_switch}; 18 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Account/Settings/Components/NotificationView.razor.cs: -------------------------------------------------------------------------------- 1 | using AntDesignBlazorDemo.Models; 2 | 3 | namespace AntDesignBlazorDemo.Pages.Account.Settings 4 | { 5 | public partial class NotificationView 6 | { 7 | private readonly UserLiteItem[] _data = 8 | { 9 | new UserLiteItem 10 | { 11 | Title = "Account Password", 12 | Description = "Messages from other users will be notified in the form of a station letter" 13 | }, 14 | new UserLiteItem 15 | { 16 | Title = "System Messages", 17 | Description = "System messages will be notified in the form of a station letter" 18 | }, 19 | new UserLiteItem 20 | { 21 | Title = "To-do Notification", 22 | Description = "The to-do list will be notified in the form of a letter from the station" 23 | } 24 | }; 25 | } 26 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Account/Settings/Components/PhoneView.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesignBlazorDemo.Pages.Account.Settings 2 | 3 |

    4 | PhoneView 5 |

    -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Account/Settings/Components/PhoneView.razor.less: -------------------------------------------------------------------------------- 1 | @import '~antd/es/style/themes/default.less'; 2 | 3 | .area_code { 4 | width: 30%; 5 | max-width: 128px; 6 | margin-right: 8px; 7 | } 8 | .phone_number { 9 | width: ~'calc(70% - 8px)'; 10 | max-width: 312px; 11 | } 12 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Account/Settings/Components/SecurityView.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesignBlazorDemo.Pages.Account.Settings 2 | 3 | 7 | 8 | 9 | @context.Title 10 | 11 | 12 | 13 | 14 | @code 15 | { 16 | private static RenderFragment _modify = @Modify; 17 | private readonly RenderFragment[] _actions = {_modify}; 18 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Account/Settings/Index.razor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using AntDesign; 3 | 4 | namespace AntDesignBlazorDemo.Pages.Account.Settings 5 | { 6 | public partial class Index 7 | { 8 | private readonly Dictionary _menuMap = new Dictionary 9 | { 10 | {"base", "Basic Settings"}, 11 | {"security", "Security Settings"}, 12 | {"binding", "Account Binding"}, 13 | {"notification", "New Message Notification"}, 14 | }; 15 | 16 | private string _selectKey = "base"; 17 | 18 | private void SelectKey(MenuItem item) 19 | { 20 | _selectKey = item.Key; 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Analysis/Components/Charts/Bar/Bar.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesignBlazorDemo.Pages.Dashboard.Analysis.Bar -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Analysis/Components/Charts/ChartCard/ChartCard.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesignBlazorDemo.Pages.Dashboard.Analysis 2 | @inherits AntDomComponentBase 3 | 4 | 5 |
    6 |
    7 |
    @Avatar
    8 |
    9 |
    10 | @Title 11 | 12 |
    13 |
    14 | @Total 15 |
    16 |
    17 |
    18 |
    19 |
    @ChildContent
    20 |
    21 | 24 |
    25 |
    26 | 27 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Analysis/Components/Charts/ChartCard/ChartCard.razor.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components; 2 | 3 | namespace AntDesignBlazorDemo.Pages.Dashboard.Analysis 4 | { 5 | public partial class ChartCard 6 | { 7 | [Parameter] 8 | public string Avatar { get; set; } 9 | 10 | [Parameter] 11 | public string Title { get; set; } 12 | 13 | [Parameter] 14 | public RenderFragment Action { get; set; } 15 | 16 | [Parameter] 17 | public string Total { get; set; } 18 | 19 | [Parameter] 20 | public RenderFragment ChildContent { get; set; } 21 | 22 | [Parameter] 23 | public RenderFragment Footer { get; set; } 24 | 25 | [Parameter] 26 | public string ContentHeight { get; set; } 27 | } 28 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Analysis/Components/Charts/Field/Field.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesignBlazorDemo.Pages.Dashboard.Analysis 2 | @inherits AntDomComponentBase 3 | 4 |
    5 | @Label 6 | @Value 7 |
    -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Analysis/Components/Charts/Field/Field.razor.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components; 2 | 3 | namespace AntDesignBlazorDemo.Pages.Dashboard.Analysis 4 | { 5 | public partial class Field 6 | { 7 | [Parameter] 8 | public string Label { get; set; } 9 | 10 | [Parameter] 11 | public string Value { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Analysis/Components/Charts/Field/Field.razor.less: -------------------------------------------------------------------------------- 1 | @import '~antd/es/style/themes/default.less'; 2 | 3 | .field { 4 | margin: 0; 5 | overflow: hidden; 6 | white-space: nowrap; 7 | text-overflow: ellipsis; 8 | .label, 9 | .number { 10 | font-size: @font-size-base; 11 | line-height: 22px; 12 | } 13 | .number { 14 | margin-left: 8px; 15 | color: @heading-color; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Analysis/Components/Charts/Gauge/Gauge.razor: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanxiaodi/MyCodeSamples/f2d7a22a91bce1c5c5eb3f5b9943ce1e85d54f6f/DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Analysis/Components/Charts/Gauge/Gauge.razor -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Analysis/Components/Charts/MiniArea/MiniArea.razor: -------------------------------------------------------------------------------- 1 | @using AntDesignBlazorDemo.Services 2 | @namespace AntDesignBlazorDemo.Pages.Dashboard.Analysis 3 | @inject IChartService ChartService 4 | 5 | 6 | 7 | @code 8 | { 9 | private IChartComponent _visitChart; 10 | 11 | private readonly AreaConfig _visitChartConfig = new AreaConfig 12 | { 13 | XField = "x", 14 | YField = "y", 15 | Height = 45, 16 | Padding = new[] { 8, 8, 8, 8 }, 17 | ForceFit = true, 18 | XAxis = new ValueCatTimeAxis 19 | { 20 | Visible = false 21 | }, 22 | YAxis = new ValueAxis 23 | { 24 | Visible = false 25 | } 26 | }; 27 | 28 | protected override async Task OnInitializedAsync() 29 | { 30 | await base.OnInitializedAsync(); 31 | var data = await ChartService.GetVisitDataAsync(); 32 | await _visitChart.ChangeData(data); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Analysis/Components/Charts/MiniArea/MiniArea.razor.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanxiaodi/MyCodeSamples/f2d7a22a91bce1c5c5eb3f5b9943ce1e85d54f6f/DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Analysis/Components/Charts/MiniArea/MiniArea.razor.cs -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Analysis/Components/Charts/MiniBar/MiniBar.razor: -------------------------------------------------------------------------------- 1 | @using AntDesignBlazorDemo.Services 2 | @namespace AntDesignBlazorDemo.Pages.Dashboard.Analysis 3 | @inject IChartService ChartService 4 | 5 | 6 | @code 7 | { 8 | private IChartComponent _chart; 9 | private ColumnConfig _chartConfig = new ColumnConfig 10 | { 11 | XField = "x", 12 | YField = "y", 13 | Height = 45, 14 | Padding = new[] { 8, 8, 8, 8 }, 15 | ForceFit = true, 16 | XAxis = new CatAxis 17 | { 18 | Visible = false 19 | }, 20 | YAxis = new ValueAxis 21 | { 22 | Visible = false 23 | } 24 | }; 25 | 26 | protected override async Task OnInitializedAsync() 27 | { 28 | await base.OnInitializedAsync(); 29 | var data = await ChartService.GetVisitDataAsync(); 30 | await _chart.ChangeData(data); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Analysis/Components/Charts/MiniProgress/MiniProgress.razor.less: -------------------------------------------------------------------------------- 1 | @import '~antd/es/style/themes/default.less'; 2 | 3 | .miniProgress { 4 | position: relative; 5 | width: 100%; 6 | padding: 5px 0; 7 | .progressWrap { 8 | position: relative; 9 | background-color: @background-color-base; 10 | } 11 | .progress { 12 | width: 0; 13 | height: 100%; 14 | background-color: @primary-color; 15 | border-radius: 1px 0 0 1px; 16 | transition: all 0.4s cubic-bezier(0.08, 0.82, 0.17, 1) 0s; 17 | } 18 | .target { 19 | position: absolute; 20 | top: 0; 21 | bottom: 0; 22 | z-index: 9; 23 | width: 20px; 24 | span { 25 | position: absolute; 26 | top: 0; 27 | left: 0; 28 | width: 2px; 29 | height: 4px; 30 | border-radius: 100px; 31 | } 32 | span:last-child { 33 | top: auto; 34 | bottom: 0; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Analysis/Components/Charts/Pie/Pie.razor: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanxiaodi/MyCodeSamples/f2d7a22a91bce1c5c5eb3f5b9943ce1e85d54f6f/DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Analysis/Components/Charts/Pie/Pie.razor -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Analysis/Components/Charts/TagCloud/TagCloud.razor: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanxiaodi/MyCodeSamples/f2d7a22a91bce1c5c5eb3f5b9943ce1e85d54f6f/DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Analysis/Components/Charts/TagCloud/TagCloud.razor -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Analysis/Components/Charts/TagCloud/TagCloud.razor.less: -------------------------------------------------------------------------------- 1 | .tagCloud { 2 | overflow: hidden; 3 | canvas { 4 | transform-origin: 0 0; 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Analysis/Components/Charts/TimelineChart/TimelineChart.razor: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanxiaodi/MyCodeSamples/f2d7a22a91bce1c5c5eb3f5b9943ce1e85d54f6f/DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Analysis/Components/Charts/TimelineChart/TimelineChart.razor -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Analysis/Components/Charts/TimelineChart/TimelineChart.razor.less: -------------------------------------------------------------------------------- 1 | @import '~antd/es/style/themes/default.less'; 2 | 3 | .timelineChart { 4 | background: @component-background; 5 | } 6 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Analysis/Components/Charts/WaterWave/WaterWave.razor: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanxiaodi/MyCodeSamples/f2d7a22a91bce1c5c5eb3f5b9943ce1e85d54f6f/DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Analysis/Components/Charts/WaterWave/WaterWave.razor -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Analysis/Components/Charts/WaterWave/WaterWave.razor.less: -------------------------------------------------------------------------------- 1 | @import '~antd/es/style/themes/default.less'; 2 | 3 | .waterWave { 4 | position: relative; 5 | display: inline-block; 6 | transform-origin: left; 7 | .text { 8 | position: absolute; 9 | top: 32px; 10 | left: 0; 11 | width: 100%; 12 | text-align: center; 13 | span { 14 | color: @text-color-secondary; 15 | font-size: 14px; 16 | line-height: 22px; 17 | } 18 | h4 { 19 | color: @heading-color; 20 | font-size: 24px; 21 | line-height: 32px; 22 | } 23 | } 24 | .waterWaveCanvasWrapper { 25 | transform: scale(0.5); 26 | transform-origin: 0 0; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Analysis/Components/Charts/index.less: -------------------------------------------------------------------------------- 1 | .miniChart { 2 | position: relative; 3 | width: 100%; 4 | .chartContent { 5 | position: absolute; 6 | bottom: -28px; 7 | width: 100%; 8 | > div { 9 | margin: 0 -5px; 10 | overflow: hidden; 11 | } 12 | } 13 | .chartLoading { 14 | position: absolute; 15 | top: 16px; 16 | left: 50%; 17 | margin-left: -7px; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Analysis/Components/NumberInfo/NumberInfo.razor: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanxiaodi/MyCodeSamples/f2d7a22a91bce1c5c5eb3f5b9943ce1e85d54f6f/DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Analysis/Components/NumberInfo/NumberInfo.razor -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Analysis/Components/PageLoading/PageLoading.razor: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanxiaodi/MyCodeSamples/f2d7a22a91bce1c5c5eb3f5b9943ce1e85d54f6f/DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Analysis/Components/PageLoading/PageLoading.razor -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Analysis/Components/SaleItem.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesignBlazorDemo.Pages.Dashboard.Analysis 2 | { 3 | public partial class SalesCard 4 | { 5 | public class SaleItem 6 | { 7 | public int Id { get; set; } 8 | public string Title { get; set; } 9 | public string Total { get; set; } 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Analysis/Components/Trend/Trend.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesignBlazorDemo.Pages.Dashboard.Analysis 2 | @inherits AntDomComponentBase 3 | 4 |
    5 | @ChildContent 6 | 7 | @if(Flag == "up"){ 8 | 9 | } else { 10 | 11 | } 12 | 13 |
    -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Analysis/Components/Trend/Trend.razor.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components; 2 | 3 | namespace AntDesignBlazorDemo.Pages.Dashboard.Analysis 4 | { 5 | public partial class Trend 6 | { 7 | [Parameter] 8 | public RenderFragment ChildContent { get; set; } 9 | 10 | [Parameter] 11 | public string Flag { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Analysis/Components/Trend/Trend.razor.less: -------------------------------------------------------------------------------- 1 | @import '~antd/es/style/themes/default.less'; 2 | 3 | .trendItem { 4 | display: inline-block; 5 | font-size: @font-size-base; 6 | line-height: 22px; 7 | 8 | .up, 9 | .down { 10 | position: relative; 11 | top: 1px; 12 | margin-left: 4px; 13 | span { 14 | font-size: 12px; 15 | transform: scale(0.83); 16 | } 17 | } 18 | .up { 19 | color: @red-6; 20 | } 21 | .down { 22 | top: -1px; 23 | color: @green-6; 24 | } 25 | 26 | &.trendItemGrey .up, 27 | &.trendItemGrey .down { 28 | color: @text-color; 29 | } 30 | 31 | &.reverseColor .up { 32 | color: @green-6; 33 | } 34 | &.reverseColor .down { 35 | color: @red-6; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Monitor/Components/Charts/Gauge/Gauge.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesignBlazorDemo.Pages.Dashboard.Monitor 2 | @inherits AntDomComponentBase 3 | 4 |
    5 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Monitor/Components/Charts/Gauge/Gauge.razor.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components; 2 | 3 | namespace AntDesignBlazorDemo.Pages.Dashboard.Monitor 4 | { 5 | public partial class Gauge 6 | { 7 | [Parameter] 8 | public string Title { get; set; } 9 | 10 | [Parameter] 11 | public string Color { get; set; } 12 | 13 | [Parameter] 14 | public int? Height { get; set; } 15 | 16 | [Parameter] 17 | public int? BgColor { get; set; } 18 | 19 | [Parameter] 20 | public int Percent { get; set; } 21 | 22 | [Parameter] 23 | public bool? ForceFit { get; set; } 24 | } 25 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Monitor/Components/Charts/Map/Map.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesignBlazorDemo.Pages.Dashboard.Monitor 2 | @inherits AntDomComponentBase 3 | 4 |
    5 | 6 | @code 7 | { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Monitor/Components/Charts/Map/MiniArea.razor: -------------------------------------------------------------------------------- 1 | @using AntDesignBlazorDemo.Models 2 | @namespace AntDesignBlazorDemo.Pages.Dashboard.Monitor 3 | 4 | 5 | 6 | @code 7 | { 8 | private IChartComponent _chart; 9 | 10 | private readonly AreaConfig _chartConfig = new AreaConfig 11 | { 12 | XField = "x", 13 | YField = "y", 14 | Height = 84, 15 | Padding = new[] { 8, 8, 8, 8 }, 16 | ForceFit = true, 17 | XAxis = new ValueCatTimeAxis 18 | { 19 | Visible = false 20 | }, 21 | YAxis = new ValueAxis 22 | { 23 | Visible = false 24 | } 25 | }; 26 | 27 | [Parameter] 28 | public ChartDataItem[] Data { get; set; } 29 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Monitor/Components/Charts/Pie/Pie.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesignBlazorDemo.Pages.Dashboard.Monitor 2 | 3 |
    -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Monitor/Components/Charts/Pie/Pie.razor.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components; 2 | 3 | namespace AntDesignBlazorDemo.Pages.Dashboard.Monitor 4 | { 5 | public partial class Pie 6 | { 7 | [Parameter] 8 | public bool? Animate { get; set; } 9 | 10 | [Parameter] 11 | public int? LineWidth { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Monitor/Components/Charts/TagCloud/TagCloud.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesignBlazorDemo.Pages.Dashboard.Monitor -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Monitor/Components/Charts/TagCloud/TagCloud.razor.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components; 2 | 3 | namespace AntDesignBlazorDemo.Pages.Dashboard.Monitor 4 | { 5 | public partial class TagCloud 6 | { 7 | [Parameter] 8 | public object[] Data { get; set; } 9 | 10 | [Parameter] 11 | public int? Height { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Monitor/Components/Charts/WaterWave/WaterWave.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesignBlazorDemo.Pages.Dashboard.Monitor 2 | 3 |
    -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Monitor/Components/Charts/WaterWave/WaterWave.razor.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components; 2 | 3 | namespace AntDesignBlazorDemo.Pages.Dashboard.Monitor 4 | { 5 | public partial class WaterWave 6 | { 7 | [Parameter] 8 | public string Title { get; set; } 9 | 10 | [Parameter] 11 | public int Percent { get; set; } 12 | 13 | [Parameter] 14 | public int? Height { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Monitor/Index.razor.less: -------------------------------------------------------------------------------- 1 | @import '~antd/es/style/themes/default.less'; 2 | 3 | .mapChart { 4 | height: 452px; 5 | padding-top: 24px; 6 | img { 7 | display: inline-block; 8 | max-width: 100%; 9 | max-height: 437px; 10 | } 11 | } 12 | 13 | .pieCard :global(.pie-stat) { 14 | font-size: 24px !important; 15 | } 16 | 17 | @media screen and (max-width: @screen-lg) { 18 | .mapChart { 19 | height: auto; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Workplace/Components/EditableLinkGroup/EditableLinkGroup.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesignBlazorDemo.Pages.Dashboard.Workplace 2 | 3 |
    4 | @foreach (var link in Links) 5 | { 6 | @link.Title 7 | } 8 | 9 | 12 |
    -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Workplace/Components/EditableLinkGroup/EditableLinkGroup.razor.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components; 2 | 3 | namespace AntDesignBlazorDemo.Pages.Dashboard.Workplace 4 | { 5 | public class EditableLink 6 | { 7 | public string Title { get; set; } 8 | public string Href { get; set; } 9 | public string Id { get; set; } 10 | } 11 | 12 | public partial class EditableLinkGroup 13 | { 14 | [Parameter] public EditableLink[] Links { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Workplace/Components/EditableLinkGroup/EditableLinkGroup.razor.less: -------------------------------------------------------------------------------- 1 | @import '~antd/es/style/themes/default.less'; 2 | 3 | .linkGroup { 4 | padding: 20px 0 8px 24px; 5 | font-size: 0; 6 | & > a { 7 | display: inline-block; 8 | width: 25%; 9 | margin-bottom: 13px; 10 | color: @text-color; 11 | font-size: @font-size-base; 12 | &:hover { 13 | color: @primary-color; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Dashboard/Workplace/Components/Radar/AutoHeight.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesignBlazorDemo.Pages.Dashboard.Workplace -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Exception/403/403.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesignBlazorDemo.Pages.Exception 2 | @page "/exception/403" 3 | 4 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Exception/404/404.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesignBlazorDemo.Pages.Exception 2 | @page "/exception/404" 3 | 4 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Exception/500/500.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesignBlazorDemo.Pages.Exception 2 | @page "/exception/500" 3 | 4 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Form/AdvancedForm/AdvancedForm.razor.cs: -------------------------------------------------------------------------------- 1 | using AntDesignBlazorDemo.Models; 2 | 3 | namespace AntDesignBlazorDemo.Pages.Form 4 | { 5 | public partial class AdvancedForm 6 | { 7 | private readonly AdvancedFormModel _model = new AdvancedFormModel(); 8 | } 9 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Form/BasicForm/BasicForm.razor.cs: -------------------------------------------------------------------------------- 1 | using AntDesignBlazorDemo.Models; 2 | 3 | namespace AntDesignBlazorDemo.Pages.Form 4 | { 5 | public partial class BasicForm 6 | { 7 | private readonly BasicFormModel _model = new BasicFormModel(); 8 | 9 | private void HandleSubmit() 10 | { 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Form/StepForm/Components/Step1/Step1.razor.cs: -------------------------------------------------------------------------------- 1 | using AntDesignBlazorDemo.Models; 2 | using Microsoft.AspNetCore.Components; 3 | 4 | namespace AntDesignBlazorDemo.Pages.Form 5 | { 6 | public partial class Step1 7 | { 8 | private readonly StepFormModel _model = new StepFormModel(); 9 | 10 | [CascadingParameter] public StepForm StepForm { get; set; } 11 | 12 | public void OnValidateForm() 13 | { 14 | StepForm.Next(); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Form/StepForm/Components/Step2/Step2.razor.cs: -------------------------------------------------------------------------------- 1 | using AntDesignBlazorDemo.Models; 2 | using Microsoft.AspNetCore.Components; 3 | 4 | namespace AntDesignBlazorDemo.Pages.Form 5 | { 6 | public partial class Step2 7 | { 8 | private readonly StepFormModel _model = new StepFormModel(); 9 | 10 | [CascadingParameter] public StepForm StepForm { get; set; } 11 | 12 | public void OnValidateForm() 13 | { 14 | StepForm.Next(); 15 | } 16 | 17 | public void Preview() 18 | { 19 | StepForm.Prev(); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Form/StepForm/Components/Step3/Step3.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesignBlazorDemo.Pages.Form 2 | 3 | 8 | 9 | 12 | 13 | 14 | 15 |
    16 | 17 | @_model.PayAccount 18 | @_model.ReceiverAccount 19 | @_model.ReceiverName 20 | 21 | 22 | 23 | 24 |
    25 |
    26 |
    -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Form/StepForm/Components/Step3/Step3.razor.cs: -------------------------------------------------------------------------------- 1 | using AntDesignBlazorDemo.Models; 2 | 3 | namespace AntDesignBlazorDemo.Pages.Form 4 | { 5 | public partial class Step3 6 | { 7 | private readonly StepFormModel _model = new StepFormModel(); 8 | 9 | public void OnFinish() 10 | { 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Form/StepForm/StepForm.razor.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesignBlazorDemo.Pages.Form 2 | { 3 | public partial class StepForm 4 | { 5 | private int _current; 6 | 7 | public void Next() 8 | { 9 | // todo: Not re-rendered 10 | _current += 1; 11 | StateHasChanged(); 12 | } 13 | 14 | public void Prev() 15 | { 16 | // todo: Not re-rendered 17 | if (_current <= 0) return; 18 | _current -= 1; 19 | StateHasChanged(); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/List/CardList/CardList.razor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | using AntDesignBlazorDemo.Models; 4 | using AntDesignBlazorDemo.Services; 5 | using Microsoft.AspNetCore.Components; 6 | using AntDesign; 7 | 8 | namespace AntDesignBlazorDemo.Pages.List 9 | { 10 | public partial class CardList 11 | { 12 | private readonly ListGridType _listGridType = new ListGridType 13 | { 14 | Gutter = 24, 15 | Column = 4 16 | }; 17 | 18 | private ListItemDataType[] _data = { }; 19 | 20 | [Inject] protected IProjectService ProjectService { get; set; } 21 | 22 | protected override async Task OnInitializedAsync() 23 | { 24 | await base.OnInitializedAsync(); 25 | var list = new List {new ListItemDataType()}; 26 | var data = await ProjectService.GetFakeListAsync(8); 27 | list.AddRange(data); 28 | _data = list.ToArray(); 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/List/Search/Applications/Components/StandardFormRow/StandardFormRow.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesignBlazorDemo.Pages.List 2 | @inherits AntDomComponentBase 3 | 4 |
    5 | @if (!string.IsNullOrEmpty(Title)) 6 | { 7 |
    8 | @Title 9 |
    10 | } 11 |
    12 | @ChildContent 13 |
    14 |
    15 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/List/Search/Applications/Components/TagSelect/TagSelect.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesignBlazorDemo.Pages.List 2 | @inherits AntDomComponentBase 3 | 4 |
    5 | @if (!HideCheckAll) 6 | { 7 | @SelectAllText 8 | } 9 | 10 | 11 | @ChildContent 12 | 13 | 14 | @if (Expandable) 15 | { 16 | 17 | @if (_expand) 18 | { 19 | @CollapseText 20 | } 21 | else 22 | { 23 | @ExpandText 24 | } 25 | 26 | } 27 |
    -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/List/Search/Applications/Components/TagSelect/TagSelect.razor.less: -------------------------------------------------------------------------------- 1 | @import '~antd/es/style/themes/default.less'; 2 | 3 | .tagSelect { 4 | position: relative; 5 | max-height: 32px; 6 | margin-left: -8px; 7 | overflow: hidden; 8 | line-height: 32px; 9 | transition: all 0.3s; 10 | user-select: none; 11 | //:global { 12 | .ant-tag { 13 | margin-right: 24px; 14 | padding: 0 8px; 15 | font-size: @font-size-base; 16 | } 17 | //} 18 | &.expanded { 19 | max-height: 200px; 20 | transition: all 0.3s; 21 | } 22 | .trigger { 23 | position: absolute; 24 | top: 0; 25 | right: 0; 26 | 27 | span.anticon { 28 | font-size: 12px; 29 | } 30 | } 31 | &.hasExpandTag { 32 | padding-right: 50px; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/List/Search/Applications/Components/TagSelect/TagSelectOption.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesignBlazorDemo.Pages.List 2 | @inherits AntDomComponentBase 3 | 4 | @ChildContent -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/List/Search/Articles/Articles.razor.less: -------------------------------------------------------------------------------- 1 | @import '~antd/es/style/themes/default.less'; 2 | 3 | a.listItemMetaTitle { 4 | color: @heading-color; 5 | } 6 | .listItemExtra { 7 | width: 272px; 8 | height: 1px; 9 | } 10 | .selfTrigger { 11 | margin-left: 12px; 12 | } 13 | 14 | @media screen and (max-width: @screen-xs) { 15 | .selfTrigger { 16 | display: block; 17 | margin-left: 0; 18 | } 19 | } 20 | @media screen and (max-width: @screen-md) { 21 | .selfTrigger { 22 | display: block; 23 | margin-left: 0; 24 | } 25 | } 26 | @media screen and (max-width: @screen-lg) { 27 | .listItemExtra { 28 | width: 0; 29 | height: 1px; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/List/Search/Projects/Projects.razor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | using AntDesignBlazorDemo.Models; 4 | using AntDesignBlazorDemo.Services; 5 | using Microsoft.AspNetCore.Components; 6 | using AntDesign; 7 | 8 | namespace AntDesignBlazorDemo.Pages.List 9 | { 10 | public partial class Projects 11 | { 12 | private readonly ListGridType _listGridType = new ListGridType 13 | { 14 | Gutter = 24, 15 | Column = 4 16 | }; 17 | 18 | private readonly ListFormModel _model = new ListFormModel(); 19 | 20 | private IList _fakeList = new List(); 21 | 22 | [Inject] public IProjectService ProjectService { get; set; } 23 | 24 | protected override async Task OnInitializedAsync() 25 | { 26 | await base.OnInitializedAsync(); 27 | _fakeList = await ProjectService.GetFakeListAsync(8); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/List/Search/SearchList.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesignBlazorDemo.Pages.List 2 | @inherits LayoutComponentBase 3 | @layout AntDesignBlazorDemo.BasicLayout 4 | 5 | 10 | 11 | 12 | Home 13 | List 14 | Search 15 | 16 | 17 | 18 |
    19 | 23 |
    24 |
    25 | 26 | @Body 27 | 28 |
    -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/List/TableList/TableList.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesignBlazorDemo.Pages.List 2 | @page "/list/table-list" 3 | 4 |

    5 | TODO: Next Version 6 |

    -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/List/TableList/TableList.razor.less: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanxiaodi/MyCodeSamples/f2d7a22a91bce1c5c5eb3f5b9943ce1e85d54f6f/DotNetConf2020Demo/AntDesignBlazorDemo/Pages/List/TableList/TableList.razor.less -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Profile/Advanced/Advanced.razor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | using AntDesign.Pro.Layout; 4 | using AntDesignBlazorDemo.Models; 5 | using AntDesignBlazorDemo.Services; 6 | using Microsoft.AspNetCore.Components; 7 | 8 | namespace AntDesignBlazorDemo.Pages.Profile 9 | { 10 | public partial class Advanced 11 | { 12 | private readonly IList _tabList = new List 13 | { 14 | new TabPaneItem {Key = "detail", Tab = "详情"}, 15 | new TabPaneItem {Key = "rules", Tab = "规则"} 16 | }; 17 | 18 | private AdvancedProfileData _data = new AdvancedProfileData(); 19 | 20 | [Inject] protected IProfileService ProfileService { get; set; } 21 | 22 | protected override async Task OnInitializedAsync() 23 | { 24 | await base.OnInitializedAsync(); 25 | _data = await ProfileService.GetAdvancedAsync(); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Profile/Basic/Basic.razor.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using AntDesignBlazorDemo.Models; 3 | using AntDesignBlazorDemo.Services; 4 | using Microsoft.AspNetCore.Components; 5 | 6 | namespace AntDesignBlazorDemo.Pages.Profile 7 | { 8 | public partial class Basic 9 | { 10 | private BasicProfileDataType _data = new BasicProfileDataType(); 11 | 12 | [Inject] protected IProfileService ProfileService { get; set; } 13 | 14 | protected override async Task OnInitializedAsync() 15 | { 16 | await base.OnInitializedAsync(); 17 | _data = await ProfileService.GetBasicAsync(); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Profile/Basic/Basic.razor.less: -------------------------------------------------------------------------------- 1 | @import '~antd/es/style/themes/default.less'; 2 | 3 | .title { 4 | margin-bottom: 16px; 5 | color: @heading-color; 6 | font-weight: 500; 7 | font-size: 16px; 8 | } 9 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Result/Fail/Fail.razor.less: -------------------------------------------------------------------------------- 1 | @import '~antd/es/style/themes/default.less'; 2 | 3 | .error_icon { 4 | color: @highlight-color; 5 | } 6 | .title__b__0 { 7 | margin-bottom: 16px; 8 | color: @heading-color; 9 | font-weight: 500; 10 | font-size: 16px; 11 | } 12 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/Result/Success/Success.razor.less: -------------------------------------------------------------------------------- 1 | @import '~antd/es/style/themes/default.less'; 2 | 3 | .title__b__1 { 4 | position: relative; 5 | color: @text-color; 6 | font-size: 12px; 7 | text-align: center; 8 | } 9 | 10 | .head-title { 11 | margin-bottom: 20px; 12 | color: @heading-color; 13 | font-weight: 500px; 14 | font-size: 16px; 15 | } 16 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/User/Register/Register.razor.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace AntDesignBlazorDemo.Pages.User 4 | { 5 | public class RegisterModel 6 | { 7 | [Required] 8 | public string UserName { get; set; } 9 | 10 | [Required] 11 | public string Password { get; set; } 12 | 13 | [Required] 14 | public string ConfirmPassword { get; set; } 15 | 16 | [Required] 17 | public string Phone { get; set; } 18 | 19 | [Required] 20 | public string Captcha { get; set; } 21 | } 22 | 23 | public partial class Register 24 | { 25 | private readonly RegisterModel _user = new RegisterModel(); 26 | 27 | public void Reg() 28 | { 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/User/Register/Register.razor.less: -------------------------------------------------------------------------------- 1 | @import '~antd/es/style/themes/default.less'; 2 | 3 | .main__b__1 { 4 | width: 368px; 5 | margin: 0 auto; 6 | 7 | h3 { 8 | margin-bottom: 20px; 9 | font-size: 16px; 10 | } 11 | 12 | .password { 13 | margin-bottom: 24px; 14 | :global { 15 | .ant-form-item-explain { 16 | display: none; 17 | } 18 | } 19 | } 20 | 21 | .getCaptcha { 22 | display: block; 23 | width: 100%; 24 | } 25 | 26 | .submit { 27 | width: 50%; 28 | } 29 | 30 | .login { 31 | float: right; 32 | line-height: @btn-height-lg; 33 | } 34 | } 35 | 36 | .success, 37 | .warning, 38 | .error { 39 | transition: color 0.3s; 40 | } 41 | 42 | .success { 43 | color: @success-color; 44 | } 45 | 46 | .warning { 47 | color: @warning-color; 48 | } 49 | 50 | .error { 51 | color: @error-color; 52 | } 53 | 54 | .progress-pass > .progress { 55 | :global { 56 | .ant-progress-bg { 57 | background-color: @warning-color; 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/User/RegisterResult/RegisterResult.razor: -------------------------------------------------------------------------------- 1 | @namespace AntDesignBlazorDemo.Pages.User 2 | @page "/user/register-result" 3 | 4 |

    RegisterResult

    5 | 6 | @code { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Pages/User/RegisterResult/RegisterResult.razor.less: -------------------------------------------------------------------------------- 1 | .registerResult { 2 | width: 800px; 3 | min-height: 400px; 4 | margin: auto; 5 | padding: 80px; 6 | background: none; 7 | :global { 8 | .anticon { 9 | font-size: 64px; 10 | } 11 | } 12 | .title { 13 | margin-top: 32px; 14 | font-size: 20px; 15 | line-height: 28px; 16 | } 17 | .actions { 18 | margin-top: 40px; 19 | a + a { 20 | margin-left: 8px; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:53775/", 7 | "sslPort": 44358 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 15 | "environmentVariables": { 16 | "ASPNETCORE_ENVIRONMENT": "Development" 17 | } 18 | }, 19 | "AntDesignBlazorDemo": { 20 | "commandName": "Project", 21 | "launchBrowser": true, 22 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | }, 26 | "applicationUrl": "https://localhost:5001;http://localhost:5000" 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/README.md: -------------------------------------------------------------------------------- 1 | # AntDesignBlazorDemo -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Services/AccountService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using AntDesignBlazorDemo.Models; 4 | 5 | namespace AntDesignBlazorDemo.Services 6 | { 7 | public interface IAccountService 8 | { 9 | Task LoginAsync(LoginParamsType model); 10 | Task GetCaptchaAsync(string modile); 11 | } 12 | 13 | public class AccountService : IAccountService 14 | { 15 | private readonly Random _random = new Random(); 16 | 17 | public Task LoginAsync(LoginParamsType model) 18 | { 19 | // todo: login logic 20 | return Task.CompletedTask; 21 | } 22 | 23 | public Task GetCaptchaAsync(string modile) 24 | { 25 | var captcha = _random.Next(0, 9999).ToString().PadLeft(4, '0'); 26 | return Task.FromResult(captcha); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Services/ProfileService.cs: -------------------------------------------------------------------------------- 1 | using System.Net.Http; 2 | using System.Net.Http.Json; 3 | using System.Threading.Tasks; 4 | using AntDesignBlazorDemo.Models; 5 | 6 | namespace AntDesignBlazorDemo.Services 7 | { 8 | public interface IProfileService 9 | { 10 | Task GetBasicAsync(); 11 | Task GetAdvancedAsync(); 12 | } 13 | 14 | public class ProfileService : IProfileService 15 | { 16 | private readonly HttpClient _httpClient; 17 | 18 | public ProfileService(HttpClient httpClient) 19 | { 20 | _httpClient = httpClient; 21 | } 22 | 23 | public async Task GetBasicAsync() 24 | { 25 | return await _httpClient.GetFromJsonAsync("data/basic.json"); 26 | } 27 | 28 | public async Task GetAdvancedAsync() 29 | { 30 | return await _httpClient.GetFromJsonAsync("data/advanced.json"); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Services/UserService.cs: -------------------------------------------------------------------------------- 1 | using System.Net.Http; 2 | using System.Net.Http.Json; 3 | using System.Threading.Tasks; 4 | using AntDesignBlazorDemo.Models; 5 | 6 | namespace AntDesignBlazorDemo.Services 7 | { 8 | public interface IUserService 9 | { 10 | Task GetCurrentUserAsync(); 11 | } 12 | 13 | public class UserService : IUserService 14 | { 15 | private readonly HttpClient _httpClient; 16 | 17 | public UserService(HttpClient httpClient) 18 | { 19 | _httpClient = httpClient; 20 | } 21 | 22 | public async Task GetCurrentUserAsync() 23 | { 24 | return await _httpClient.GetFromJsonAsync("data/current_user.json"); 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/Utils/LongToDateTimeConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Buffers.Text; 3 | using System.Text.Json; 4 | using System.Text.Json.Serialization; 5 | 6 | namespace AntDesignBlazorDemo.Utils 7 | { 8 | public class LongToDateTimeConverter : JsonConverter 9 | { 10 | public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 11 | { 12 | if (Utf8Parser.TryParse(reader.ValueSpan, out long value, out _)) 13 | return DateTime.UnixEpoch.AddMilliseconds(value); 14 | 15 | throw new FormatException(); 16 | } 17 | 18 | public override void Write(Utf8JsonWriter writer, DateTime value, JsonSerializerOptions options) 19 | { 20 | writer.WriteStringValue( 21 | JsonEncodedText.Encode(((long) (value - DateTime.UnixEpoch).TotalMilliseconds).ToString())); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using AntDesign 2 | @using AntDesign.Charts 3 | @using AntDesign.Pro.Layout 4 | @using System.Net.Http 5 | @using System.Net.Http.Json 6 | @using Microsoft.AspNetCore.Components.Forms 7 | @using Microsoft.AspNetCore.Components.Routing 8 | @using Microsoft.AspNetCore.Components.Web 9 | @using Microsoft.AspNetCore.Components.WebAssembly.Http 10 | @using Microsoft.JSInterop 11 | @using AntDesignBlazorDemo 12 | @using AntDesignBlazorDemo.Models 13 | @using AntDesignBlazorDemo.Services 14 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/gulpfile.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'), 2 | cleanCss = require('gulp-clean-css'), 3 | less = require('gulp-less'), 4 | rename = require('gulp-rename'), 5 | concatCss = require("gulp-concat-css"), 6 | npmImport = require("less-plugin-npm-import"); 7 | 8 | gulp.task('less', function () { 9 | return gulp 10 | .src([ 11 | '**/*.less', 12 | '!node_modules/**' 13 | ]) 14 | .pipe(less({ 15 | javascriptEnabled: true, 16 | plugins: [new npmImport({ prefix: '~' })] 17 | })) 18 | .pipe(concatCss('site.css')) 19 | .pipe(cleanCss({ compatibility: '*' })) 20 | .pipe(gulp.dest('wwwroot/css')); 21 | }); 22 | 23 | gulp.task('default', gulp.parallel('less'), function () { }) -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "AntDesignBlazorDemo", 3 | "version": "1.0.0", 4 | "description": "An out-of-box UI solution for enterprise applications as a Blazor boilerplate.", 5 | "scripts": { 6 | "start": "dotnet watch -p ./AntDesignBlazorDemo run", 7 | "build": "dotnet publish -o dist", 8 | "gulp:pro": "gulp --gulpfile ./gulpfile.js", 9 | "test": "echo \"Error: no test specified\" && exit 1" 10 | }, 11 | "dependencies": { 12 | "antd": "^4.6.0" 13 | }, 14 | "devDependencies": { 15 | "gulp": "^4.0.2", 16 | "gulp-clean-css": "^4.2.0", 17 | "gulp-concat-css": "^3.1.0", 18 | "gulp-less": "^4.0.1", 19 | "gulp-rename": "^2.0.0", 20 | "gulp-sourcemaps": "^2.6.5", 21 | "gulp-uglify": "^3.0.2", 22 | "less-plugin-npm-import": "^2.1.0", 23 | "husky": "^4.2.3", 24 | "vinyl-buffer": "^1.0.1", 25 | "vinyl-source-stream": "^2.0.0" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/styles/global.less: -------------------------------------------------------------------------------- 1 | @import '~antd/es/style/themes/default.less'; 2 | 3 | html, 4 | body, 5 | #root, 6 | #app, 7 | app { 8 | height: 100%; 9 | } 10 | 11 | .colorWeak { 12 | filter: invert(80%); 13 | } 14 | 15 | .ant-layout { 16 | min-height: 100vh; 17 | } 18 | 19 | canvas { 20 | display: block; 21 | } 22 | 23 | body { 24 | text-rendering: optimizeLegibility; 25 | -webkit-font-smoothing: antialiased; 26 | -moz-osx-font-smoothing: grayscale; 27 | } 28 | 29 | ul, 30 | ol { 31 | list-style: none; 32 | } 33 | 34 | @media (max-width: @screen-xs) { 35 | .ant-table { 36 | width: 100%; 37 | overflow-x: auto; 38 | 39 | &-thead > tr, 40 | &-tbody > tr { 41 | > th, 42 | > td { 43 | white-space: pre; 44 | 45 | > span { 46 | display: block; 47 | } 48 | } 49 | } 50 | } 51 | } 52 | 53 | // 兼容IE11 54 | @media screen and(-ms-high-contrast: active), (-ms-high-contrast: none) { 55 | body .ant-design-pro > .ant-layout { 56 | min-height: 100vh; 57 | } 58 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/wwwroot/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ProSettings": { 3 | "NavTheme": "dark", 4 | "Layout": "side", 5 | "ContentWidth": "Fluid", 6 | "FixedHeader": false, 7 | "FixSiderbar": true, 8 | "Title": "Ant Design Pro", 9 | "PrimaryColor": "daybreak", 10 | "ColorWeak": false, 11 | "SplitMenus": false, 12 | "HeaderRender": true, 13 | "FooterRender": true, 14 | "MenuRender": true, 15 | "MenuHeaderRender": true, 16 | "HeaderHeight": 48 17 | } 18 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/wwwroot/data/advanced.json: -------------------------------------------------------------------------------- 1 | {"advancedOperation1":[{"key":"op1","type":"订购关系生效","name":"曲丽丽","status":"agree","updatedAt":"2017-10-03 19:23:12","memo":"-"},{"key":"op2","type":"财务复审","name":"付小小","status":"reject","updatedAt":"2017-10-03 19:23:12","memo":"不通过原因"},{"key":"op3","type":"部门初审","name":"周毛毛","status":"agree","updatedAt":"2017-10-03 19:23:12","memo":"-"},{"key":"op4","type":"提交订单","name":"林东东","status":"agree","updatedAt":"2017-10-03 19:23:12","memo":"很棒"},{"key":"op5","type":"创建订单","name":"汗牙牙","status":"agree","updatedAt":"2017-10-03 19:23:12","memo":"-"}],"advancedOperation2":[{"key":"op1","type":"订购关系生效","name":"曲丽丽","status":"agree","updatedAt":"2017-10-03 19:23:12","memo":"-"}],"advancedOperation3":[{"key":"op1","type":"创建订单","name":"汗牙牙","status":"agree","updatedAt":"2017-10-03 19:23:12","memo":"-"}]} -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/wwwroot/data/basic.json: -------------------------------------------------------------------------------- 1 | {"basicGoods":[{"id":"1234561","name":"矿泉水 550ml","barcode":"12421432143214321","price":"2.00","num":"1","amount":"2.00"},{"id":"1234562","name":"凉茶 300ml","barcode":"12421432143214322","price":"3.00","num":"2","amount":"6.00"},{"id":"1234563","name":"好吃的薯片","barcode":"12421432143214323","price":"7.00","num":"4","amount":"28.00"},{"id":"1234564","name":"特别好吃的蛋卷","barcode":"12421432143214324","price":"8.50","num":"3","amount":"25.50"}],"basicProgress":[{"key":"1","time":"2017-10-01 14:10","rate":"联系客户","status":"processing","operator":"取货员 ID1234","cost":"5mins"},{"key":"2","time":"2017-10-01 14:05","rate":"取货员出发","status":"success","operator":"取货员 ID1234","cost":"1h"},{"key":"3","time":"2017-10-01 13:05","rate":"取货员接单","status":"success","operator":"取货员 ID1234","cost":"5mins"},{"key":"4","time":"2017-10-01 13:00","rate":"申请审批通过","status":"success","operator":"系统","cost":"1h"},{"key":"5","time":"2017-10-01 12:00","rate":"发起退货申请","status":"success","operator":"用户","cost":"5mins"}]} -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/wwwroot/data/current_user.json: -------------------------------------------------------------------------------- 1 | {"name":"Serati Ma","avatar":"https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png","userid":"00000001","email":"antdesign@alipay.com","signature":"海纳百川,有容乃大","title":"交互专家","group":"蚂蚁金服-某某某事业群-某某平台部-某某技术部-UED","tags":[{"key":"0","label":"很有想法的"},{"key":"1","label":"专注设计"},{"key":"2","label":"辣~"},{"key":"3","label":"大长腿"},{"key":"4","label":"川妹子"},{"key":"5","label":"海纳百川"}],"notifyCount":12,"unreadCount":11,"country":"China","geographic":{"province":{"label":"浙江省","key":"330000"},"city":{"label":"杭州市","key":"330100"}},"address":"西湖区工专路 77 号","phone":"0752-268888888"} -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanxiaodi/MyCodeSamples/f2d7a22a91bce1c5c5eb3f5b9943ce1e85d54f6f/DotNetConf2020Demo/AntDesignBlazorDemo/wwwroot/favicon.ico -------------------------------------------------------------------------------- /DotNetConf2020Demo/AntDesignBlazorDemo/wwwroot/pro_icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/BlazorAppDemo/App.razor: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

    Sorry, there's nothing at this address.

    8 |
    9 |
    10 |
    11 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/BlazorAppDemo/BlazorAppDemo.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/BlazorAppDemo/Pages/Counter.razor: -------------------------------------------------------------------------------- 1 | @page "/counter" 2 | 3 |

    Counter

    4 | 5 |

    Current count: @currentCount

    6 | 7 | 8 | 9 | @code { 10 | private int currentCount = 0; 11 | 12 | private void IncrementCount() 13 | { 14 | currentCount += 2; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/BlazorAppDemo/Pages/Index.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 |

    Hello, world!

    4 | 5 | Welcome to your new app. 6 | 7 | Hey .NET User Group! 8 | 9 | 10 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/BlazorAppDemo/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components.WebAssembly.Hosting; 2 | using Microsoft.Extensions.Configuration; 3 | using Microsoft.Extensions.DependencyInjection; 4 | using Microsoft.Extensions.Logging; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Net.Http; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | 11 | namespace BlazorAppDemo 12 | { 13 | public class Program 14 | { 15 | public static async Task Main(string[] args) 16 | { 17 | var builder = WebAssemblyHostBuilder.CreateDefault(args); 18 | builder.RootComponents.Add("#app"); 19 | 20 | builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); 21 | 22 | await builder.Build().RunAsync(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/BlazorAppDemo/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:46129", 7 | "sslPort": 44364 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 15 | "environmentVariables": { 16 | "ASPNETCORE_ENVIRONMENT": "Development" 17 | } 18 | }, 19 | "BlazorAppDemo": { 20 | "commandName": "Project", 21 | "dotnetRunMessages": "true", 22 | "launchBrowser": true, 23 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 24 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 25 | "environmentVariables": { 26 | "ASPNETCORE_ENVIRONMENT": "Development" 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/BlazorAppDemo/Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 |
    4 | 7 | 8 |
    9 |
    10 | About 11 |
    12 | 13 |
    14 | @Body 15 |
    16 |
    17 |
    18 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/BlazorAppDemo/Shared/SurveyPrompt.razor: -------------------------------------------------------------------------------- 1 |  11 | 12 | @code { 13 | // Demonstrates how a parent component can supply parameters 14 | [Parameter] 15 | public string Title { get; set; } 16 | } 17 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/BlazorAppDemo/_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 BlazorAppDemo 10 | @using BlazorAppDemo.Shared 11 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/BlazorAppDemo/wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanxiaodi/MyCodeSamples/f2d7a22a91bce1c5c5eb3f5b9943ce1e85d54f6f/DotNetConf2020Demo/BlazorAppDemo/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /DotNetConf2020Demo/BlazorAppDemo/wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanxiaodi/MyCodeSamples/f2d7a22a91bce1c5c5eb3f5b9943ce1e85d54f6f/DotNetConf2020Demo/BlazorAppDemo/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /DotNetConf2020Demo/BlazorAppDemo/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanxiaodi/MyCodeSamples/f2d7a22a91bce1c5c5eb3f5b9943ce1e85d54f6f/DotNetConf2020Demo/BlazorAppDemo/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /DotNetConf2020Demo/BlazorAppDemo/wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanxiaodi/MyCodeSamples/f2d7a22a91bce1c5c5eb3f5b9943ce1e85d54f6f/DotNetConf2020Demo/BlazorAppDemo/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /DotNetConf2020Demo/BlazorAppDemo/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanxiaodi/MyCodeSamples/f2d7a22a91bce1c5c5eb3f5b9943ce1e85d54f6f/DotNetConf2020Demo/BlazorAppDemo/wwwroot/favicon.ico -------------------------------------------------------------------------------- /DotNetConf2020Demo/BlazorAppDemo/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | BlazorAppDemo 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
    Loading...
    16 | 17 |
    18 | An unhandled error has occurred. 19 | Reload 20 | 🗙 21 |
    22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/BlazorAppDemo/wwwroot/sample-data/weather.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "date": "2018-05-06", 4 | "temperatureC": 1, 5 | "summary": "Freezing" 6 | }, 7 | { 8 | "date": "2018-05-07", 9 | "temperatureC": 14, 10 | "summary": "Bracing" 11 | }, 12 | { 13 | "date": "2018-05-08", 14 | "temperatureC": -13, 15 | "summary": "Freezing" 16 | }, 17 | { 18 | "date": "2018-05-09", 19 | "temperatureC": -16, 20 | "summary": "Balmy" 21 | }, 22 | { 23 | "date": "2018-05-10", 24 | "temperatureC": -2, 25 | "summary": "Chilly" 26 | } 27 | ] 28 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/RecordDemo/RecordDemo.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net5.0 6 | latest 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/TopLevelStatements/Program.cs: -------------------------------------------------------------------------------- 1 | //using System; 2 | 3 | //namespace TopLevelStatements 4 | //{ 5 | // class Program 6 | // { 7 | // static void Main(string[] args) 8 | // { 9 | // Console.WriteLine("Hello World!"); 10 | // } 11 | // } 12 | //} 13 | 14 | //using static System.Console; 15 | System.Console.WriteLine("Hello World!"); 16 | 17 | var person = new Person { FirstName = "Jack" }; 18 | System.Console.WriteLine(person.FirstName); 19 | class Person 20 | { 21 | public string FirstName { get; set; } 22 | } -------------------------------------------------------------------------------- /DotNetConf2020Demo/TopLevelStatements/TopLevelStatements.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net5.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /DotNetConf2020Demo/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "lockfileVersion": 1 3 | } 4 | -------------------------------------------------------------------------------- /DotNetConf2022Demo/DotNetConf2022Demo/BulkUpdatesDemo/BulkUpdatesDemo.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net7.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | all 12 | runtime; build; native; contentfiles; analyzers; buildtransitive 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /DotNetConf2022Demo/DotNetConf2022Demo/CSharpDemo/CSharpDemo.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net7.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /DotNetConf2022Demo/DotNetConf2022Demo/CSharpDemo/FileScope/File1.cs: -------------------------------------------------------------------------------- 1 | namespace CSharpDemo.FileScope 2 | { 3 | // In File1.cs: 4 | file interface IWidget 5 | { 6 | void ProvideAnswer(); 7 | } 8 | 9 | file class HiddenWidget 10 | { 11 | public int Work() => 42; 12 | } 13 | 14 | public class Widget : IWidget 15 | { 16 | public void ProvideAnswer() 17 | { 18 | var worker = new HiddenWidget(); 19 | var result = worker.Work(); 20 | Console.WriteLine($"The answer is {result} from Widget in File1.cs"); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /DotNetConf2022Demo/DotNetConf2022Demo/CSharpDemo/FileScope/File2.cs: -------------------------------------------------------------------------------- 1 | namespace CSharpDemo.FileScope 2 | { 3 | // In File2.cs: 4 | // Doesn't conflict with HiddenWidget 5 | // declared in File1.cs 6 | public class HiddenWidget 7 | { 8 | public void RunTask() 9 | { 10 | Console.WriteLine("Hello from HiddenWidget in File2.cs"); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DotNetConf2022Demo/DotNetConf2022Demo/CSharpDemo/Program.cs: -------------------------------------------------------------------------------- 1 | // See https://aka.ms/new-console-template for more information 2 | 3 | 4 | //Console.WriteLine("Hello, World!"); 5 | 6 | using CSharpDemo; 7 | 8 | StringInterpolation.ContainNewLine(); 9 | //StringInterpolation.RawStringLiteral(); 10 | //StringInterpolation.RawStringLiteralMultipleDenotes(); 11 | //StringInterpolation.RawStringLiteralMultipleLines(); 12 | 13 | // Required member 14 | //RequiredMember.CreatePerson(); 15 | 16 | // File scope 17 | //var widget = new Widget(); 18 | //widget.ProvideAnswer(); 19 | 20 | //var hiddenWidget = new HiddenWidget(); 21 | //hiddenWidget.RunTask(); 22 | 23 | -------------------------------------------------------------------------------- /DotNetConf2022Demo/DotNetConf2022Demo/CSharpDemo/RequiredMember.cs: -------------------------------------------------------------------------------- 1 | namespace CSharpDemo 2 | { 3 | public class RequiredMember 4 | { 5 | public static void CreatePerson() 6 | { 7 | // Without the required member, we can create an instance using the default constructor: 8 | var person = new Person(); 9 | //var person = new Person("Jack"); 10 | //var person = new Person() { FirstName = "Jack" }; 11 | Console.WriteLine($"The person's name is {person.FirstName}"); 12 | } 13 | } 14 | 15 | public class Person 16 | { 17 | public Person() { } 18 | 19 | // SetsRequiredMembers attribute Specifies that this constructor sets all required members for the current type 20 | //[SetsRequiredMembers] 21 | public Person(string firstName) => FirstName = firstName; 22 | 23 | public string FirstName { get; init; } 24 | 25 | //public required string FirstName { get; init; } 26 | 27 | // Omitted for brevity. 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /DotNetConf2022Demo/DotNetConf2022Demo/JsonColumnsDemo/JsonColumnsDemo.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net7.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | all 13 | runtime; build; native; contentfiles; analyzers; buildtransitive 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /DotNetConf2022Demo/DotNetConf2022Demo/JsonColumnsDemo/Models.cs: -------------------------------------------------------------------------------- 1 | namespace JsonColumnsDemo; 2 | 3 | public class Author 4 | { 5 | public int Id { get; set; } 6 | public string Name { get; set; } = string.Empty; 7 | public ContactDetails Contact { get; set; } = null!; 8 | } 9 | 10 | public class ContactDetails 11 | { 12 | public Address Address { get; set; } = null!; 13 | public string? Phone { get; set; } 14 | } 15 | 16 | public class Address 17 | { 18 | public Address(string street, string city, string postcode, string country) 19 | { 20 | Street = street; 21 | City = city; 22 | Postcode = postcode; 23 | Country = country; 24 | } 25 | 26 | public string Street { get; set; } 27 | public string City { get; set; } 28 | public string Postcode { get; set; } 29 | public string Country { get; set; } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /DotNetConf2022Demo/DotNetConf2022Demo/JsonColumnsDemo/Program.cs: -------------------------------------------------------------------------------- 1 | // See https://aka.ms/new-console-template for more information 2 | 3 | using JsonColumnsDemo; 4 | using Microsoft.EntityFrameworkCore; 5 | 6 | Console.WriteLine("Hello, World!"); 7 | 8 | await using var dbContext = new JsonColumnsDbContext(); 9 | // Initialize the database 10 | await DbInitializer.InitializeAsync(dbContext); 11 | 12 | // Query 13 | var authorsInLondon = await dbContext.Authors.Where(x => x.Contact.Address.City == "London").ToListAsync(); 14 | Console.WriteLine($"There are {authorsInLondon.Count} authors in London"); 15 | // Output all the authors in London 16 | foreach (var author in authorsInLondon) 17 | { 18 | Console.WriteLine($"{author.Name} lives at {author.Contact.Address.Street}, {author.Contact.Address.City}, {author.Contact.Address.Postcode}, {author.Contact.Address.Country}"); 19 | } 20 | -------------------------------------------------------------------------------- /DotNetConf2022Demo/DotNetConf2022Demo/RateLimitingDemo/RateLimitingDemo.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net7.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /DotNetConf2022Demo/DotNetConf2022Demo/RateLimitingDemo/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace RateLimitingDemo 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 | } -------------------------------------------------------------------------------- /DotNetConf2022Demo/DotNetConf2022Demo/RateLimitingDemo/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /DotNetConf2022Demo/DotNetConf2022Demo/RateLimitingDemo/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/SummarizePlugin/MakeAbstractReadable/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "description": "Given a scientific white paper abstract, rewrite it to make it more readable", 4 | "execution_settings": { 5 | "default": { 6 | "max_tokens": 4000, 7 | "temperature": 0.0, 8 | "top_p": 1.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 2.0 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/SummarizePlugin/MakeAbstractReadable/skprompt.txt: -------------------------------------------------------------------------------- 1 | {{$input}} 2 | 3 | == 4 | Summarize, using a user friendly, using simple grammar. Don't use subjects like "we" "our" "us" "your". 5 | == -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/SummarizePlugin/Notegen/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "description": "Automatically generate compact notes for any text or text document.", 4 | "execution_settings": { 5 | "default": { 6 | "max_tokens": 256, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/SummarizePlugin/Notegen/skprompt.txt: -------------------------------------------------------------------------------- 1 | Analyze the following extract taken from a document. 2 | - Produce key points for memory. 3 | - Give memory a name. 4 | - Extract only points worth remembering. 5 | - Be brief. Conciseness is very important. 6 | - Use broken English. 7 | You will use this memory to analyze the rest of this document, and for other relevant tasks. 8 | 9 | [Input] 10 | My name is Macbeth. I used to be King of Scotland, but I died. My wife's name is Lady Macbeth and we were married for 15 years. We had no children. Our beloved dog Toby McDuff was a famous hunter of rats in the forest. 11 | My story was immortalized by Shakespeare in a play. 12 | +++++ 13 | Family History 14 | - Macbeth, King Scotland 15 | - Wife Lady Macbeth, No Kids 16 | - Dog Toby McDuff. Hunter, dead. 17 | - Shakespeare play 18 | 19 | [Input] 20 | [[{{$input}}]] 21 | +++++ 22 | -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/SummarizePlugin/Summarize/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "description": "Summarize given text or any text document", 4 | "execution_settings": { 5 | "default": { 6 | "max_tokens": 512, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | } 12 | }, 13 | "input_variables": [ 14 | { 15 | "name": "input", 16 | "description": "Text to summarize", 17 | "default": "", 18 | "is_required": true 19 | } 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/SummarizePlugin/Summarize/skprompt.txt: -------------------------------------------------------------------------------- 1 | [SUMMARIZATION RULES] 2 | DONT WASTE WORDS 3 | USE SHORT, CLEAR, COMPLETE SENTENCES. 4 | DO NOT USE BULLET POINTS OR DASHES. 5 | USE ACTIVE VOICE. 6 | MAXIMIZE DETAIL, MEANING 7 | FOCUS ON THE CONTENT 8 | 9 | [BANNED PHRASES] 10 | This article 11 | This document 12 | This page 13 | This material 14 | [END LIST] 15 | 16 | Summarize: 17 | Hello how are you? 18 | +++++ 19 | Hello 20 | 21 | Summarize this 22 | {{$input}} 23 | +++++ -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/SummarizePlugin/Topics/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "description": "Analyze given text or document and extract key topics worth remembering", 4 | "execution_settings": { 5 | "default": { 6 | "max_tokens": 128, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/SummarizePlugin/Topics/skprompt.txt: -------------------------------------------------------------------------------- 1 | Analyze the following extract taken from a document and extract key topics. 2 | - Topics only worth remembering. 3 | - Be brief. Short phrases. 4 | - Can use broken English. 5 | - Conciseness is very important. 6 | - Topics can include names of memories you want to recall. 7 | - NO LONG SENTENCES. SHORT PHRASES. 8 | - Return in JSON 9 | [Input] 10 | My name is Macbeth. I used to be King of Scotland, but I died. My wife's name is Lady Macbeth and we were married for 15 years. We had no children. Our beloved dog Toby McDuff was a famous hunter of rats in the forest. 11 | My tragic story was immortalized by Shakespeare in a play. 12 | [Output] 13 | { 14 | "topics": [ 15 | "Macbeth", 16 | "King of Scotland", 17 | "Lady Macbeth", 18 | "Dog", 19 | "Toby McDuff", 20 | "Shakespeare", 21 | "Play", 22 | "Tragedy" 23 | ] 24 | } 25 | +++++ 26 | [Input] 27 | {{$input}} 28 | [Output] -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/WriterPlugin/Acronym/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "description": "Generate an acronym for the given concept or phrase", 4 | "execution_settings": { 5 | "default": { 6 | "max_tokens": 100, 7 | "temperature": 0.5, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/WriterPlugin/AcronymGenerator/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "description": "Given a request to generate an acronym from a string, generate an acronym and provide the acronym explanation.", 4 | "execution_settings": { 5 | "default": { 6 | "max_tokens": 256, 7 | "temperature": 0.7, 8 | "top_p": 1.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0, 11 | "stop_sequences": [ 12 | "#" 13 | ] 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/WriterPlugin/AcronymReverse/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "description": "Given a single word or acronym, generate the expanded form matching the acronym letters.", 4 | "execution_settings": { 5 | "default": { 6 | "max_tokens": 256, 7 | "temperature": 0.5, 8 | "top_p": 1.0, 9 | "presence_penalty": 0.8, 10 | "frequency_penalty": 0.0, 11 | "stop_sequences": [ 12 | "#END#" 13 | ] 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/WriterPlugin/AcronymReverse/skprompt.txt: -------------------------------------------------------------------------------- 1 | # acronym: Devis 2 | Sentences matching the acronym: 3 | 1. Dragons Eat Very Interesting Snacks 4 | 2. Develop Empathy and Vision to Increase Success 5 | 3. Don't Expect Vampires In Supermarkets 6 | #END# 7 | 8 | # acronym: Christmas 9 | Sentences matching the acronym: 10 | 1. Celebrating Harmony and Respect in a Season of Togetherness, Merriment, and True joy 11 | 2. Children Have Real Interest Since The Mystery And Surprise Thrills 12 | 3. Christmas Helps Reduce Inner Stress Through Mistletoe And Sleigh excursions 13 | #END# 14 | 15 | # acronym: noWare 16 | Sentences matching the acronym: 17 | 1. No One Wants an App that Randomly Erases everything 18 | 2. Nourishing Oatmeal With Almond, Raisin, and Egg toppings 19 | 3. Notice Opportunity When Available and React Enthusiastically 20 | #END# 21 | 22 | Reverse the following acronym back to a funny sentence. Provide 3 examples. 23 | # acronym: {{$INPUT}} 24 | Sentences matching the acronym: 25 | -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/WriterPlugin/Brainstorm/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "description": "Given a goal or topic description generate a list of ideas", 4 | "execution_settings": { 5 | "default": { 6 | "max_tokens": 2000, 7 | "temperature": 0.5, 8 | "top_p": 1.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0, 11 | "stop_sequences": ["##END##"] 12 | } 13 | }, 14 | "input_variables": [ 15 | { 16 | "name": "input", 17 | "description": "A topic description or goal.", 18 | "default": "" 19 | } 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/WriterPlugin/Brainstorm/skprompt.txt: -------------------------------------------------------------------------------- 1 | Must: brainstorm ideas and create a list. 2 | Must: use a numbered list. 3 | Must: only one list. 4 | Must: end list with ##END## 5 | Should: no more than 10 items. 6 | Should: at least 3 items. 7 | Topic: {{$INPUT}} 8 | Start. 9 | -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/WriterPlugin/EmailGen/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "description": "Write an email from the given bullet points", 4 | "execution_settings": { 5 | "default": { 6 | "max_tokens": 256, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/WriterPlugin/EmailGen/skprompt.txt: -------------------------------------------------------------------------------- 1 | Rewrite my bullet points into complete sentences. Use a polite and inclusive tone. 2 | 3 | [Input] 4 | - Macbeth, King Scotland 5 | - Married, Wife Lady Macbeth, No Kids 6 | - Dog Toby McDuff. Hunter, dead. 7 | - Shakespeare play 8 | +++++ 9 | The story of Macbeth 10 | My name is Macbeth. I used to be King of Scotland, but I died. My wife's name is Lady Macbeth and we were married for 15 years. We had no children. Our beloved dog Toby McDuff was a famous hunter of rats in the forest. 11 | My story was immortalized by Shakespeare in a play. 12 | 13 | +++++ 14 | [Input] 15 | {{$input}} 16 | +++++ 17 | -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/WriterPlugin/EmailTo/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "description": "Turn bullet points into an email to someone, using a polite tone", 4 | "execution_settings": { 5 | "default": { 6 | "max_tokens": 256, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/WriterPlugin/EmailTo/skprompt.txt: -------------------------------------------------------------------------------- 1 | Rewrite my bullet points into an email featuring complete sentences. Use a polite and inclusive tone. 2 | 3 | [Input] 4 | Toby, 5 | 6 | - Macbeth, King Scotland 7 | - Married, Wife Lady Macbeth, No Kids 8 | - Dog Toby McDuff. Hunter, dead. 9 | - Shakespeare play 10 | 11 | Thanks, 12 | Dexter 13 | 14 | +++++ 15 | Hi Toby, 16 | 17 | The story of Macbeth 18 | My name is Macbeth. I used to be King of Scotland, but I died. My wife's name is Lady Macbeth and we were married for 15 years. We had no children. Our beloved dog Toby McDuff was a famous hunter of rats in the forest. 19 | My story was immortalized by Shakespeare in a play. 20 | 21 | Thanks, 22 | Dexter 23 | 24 | +++++ 25 | [Input] 26 | {{$to}} 27 | {{$input}} 28 | 29 | Thanks, 30 | {{$sender}} 31 | +++++ 32 | -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/WriterPlugin/EnglishImprover/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "description": "Translate text to English and improve it", 4 | "execution_settings": { 5 | "default": { 6 | "max_tokens": 3000, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/WriterPlugin/EnglishImprover/skprompt.txt: -------------------------------------------------------------------------------- 1 | I want you to act as an English translator, spelling corrector and improver. 2 | I will speak to you in any language and you will detect the language, translate it and answer in the corrected and improved version of my text, in English. 3 | I want you to replace my simplified A0-level words and sentences with more beautiful and elegant, upper level English words and sentences. 4 | Keep the meaning same, but make them more literary. 5 | I want you to only reply the correction, the improvements and nothing else, do not write explanations. 6 | 7 | Sentence: """ 8 | {{$INPUT}} 9 | """ 10 | 11 | Translation: 12 | -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/WriterPlugin/NovelChapter/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "description": "Write a chapter of a novel.", 4 | "execution_settings": { 5 | "default": { 6 | "max_tokens": 2048, 7 | "temperature": 0.3, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | } 12 | }, 13 | "input_variables": [ 14 | { 15 | "name": "input", 16 | "description": "A synopsis of what the chapter should be about.", 17 | "default": "" 18 | }, 19 | { 20 | "name": "theme", 21 | "description": "The theme or topic of this novel.", 22 | "default": "" 23 | }, 24 | { 25 | "name": "previousChapter", 26 | "description": "The synopsis of the previous chapter.", 27 | "default": "" 28 | }, 29 | { 30 | "name": "chapterIndex", 31 | "description": "The number of the chapter to write.", 32 | "default": "" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/WriterPlugin/NovelChapter/skprompt.txt: -------------------------------------------------------------------------------- 1 | [CONTEXT] 2 | 3 | THEME OF STORY: 4 | {{$theme}} 5 | 6 | PREVIOUS CHAPTER: 7 | {{$previousChapter}} 8 | 9 | [END CONTEXT] 10 | 11 | 12 | WRITE THIS CHAPTER USING [CONTEXT] AND 13 | CHAPTER SYNOPSIS. DO NOT REPEAT SYNOPSIS IN THE OUTPUT 14 | 15 | Chapter Synopsis: 16 | {{$input}} 17 | 18 | Chapter {{$chapterIndex}} 19 | 20 | 21 | -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/WriterPlugin/NovelChapterWithNotes/skprompt.txt: -------------------------------------------------------------------------------- 1 | [CONTEXT] 2 | 3 | THEME OF STORY: 4 | {{$theme}} 5 | 6 | NOTES OF STORY SO FAR - USE AS REFERENCE 7 | {{$notes}} 8 | 9 | PREVIOUS CHAPTER, USE AS REFERENCE: 10 | {{$previousChapter}} 11 | 12 | [END CONTEXT] 13 | 14 | 15 | WRITE THIS CHAPTER CONTINUING STORY, USING [CONTEXT] AND CHAPTER SYNOPSIS BELOW. DO NOT REPEAT SYNOPSIS IN THE CHAPTER. DON'T REPEAT PREVIOUS CHAPTER. 16 | 17 | {{$input}} 18 | 19 | Chapter {{$chapterIndex}} 20 | -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/WriterPlugin/NovelOutline/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "description": "Generate a list of chapter synopsis for a novel or novella", 4 | "execution_settings": { 5 | "default": { 6 | "max_tokens": 2048, 7 | "temperature": 0.1, 8 | "top_p": 0.5, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | } 12 | }, 13 | "input_variables": [ 14 | { 15 | "name": "input", 16 | "description": "What the novel should be about.", 17 | "default": "" 18 | }, 19 | { 20 | "name": "chapterCount", 21 | "description": "The number of chapters to generate.", 22 | "default": "" 23 | }, 24 | { 25 | "name": "endMarker", 26 | "description": "The marker to use to end each chapter.", 27 | "default": "" 28 | } 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/WriterPlugin/NovelOutline/skprompt.txt: -------------------------------------------------------------------------------- 1 | I want to write a {{$chapterCount}} chapter novella about: 2 | {{$input}} 3 | 4 | There MUST BE {{$chapterCount}} CHAPTERS. 5 | 6 | INVENT CHARACTERS AS YOU SEE FIT. BE HIGHLY CREATIVE AND/OR FUNNY. 7 | WRITE SYNOPSIS FOR EACH CHAPTER. INCLUDE INFORMATION ABOUT CHARACTERS ETC. SINCE EACH 8 | CHAPTER WILL BE WRITTEN BY A DIFFERENT WRITER, YOU MUST INCLUDE ALL PERTINENT INFORMATION 9 | IN EACH SYNOPSIS 10 | 11 | YOU MUST END EACH SYNOPSIS WITH {{$endMarker}} 12 | 13 | -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/WriterPlugin/Rewrite/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "description": "Automatically generate compact notes for any text or text document", 4 | "execution_settings": { 5 | "default": { 6 | "max_tokens": 256, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/WriterPlugin/Rewrite/skprompt.txt: -------------------------------------------------------------------------------- 1 | Rewrite the given text like it was written in this style or by: {{$style}}. 2 | MUST RETAIN THE MEANING AND FACTUAL CONTENT AS THE ORIGINAL. 3 | 4 | 5 | {{$input}} 6 | 7 | -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/WriterPlugin/ShortPoem/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "description": "Turn a scenario into a short and entertaining poem.", 4 | "execution_settings": { 5 | "default": { 6 | "max_tokens": 60, 7 | "temperature": 0.5, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | } 12 | }, 13 | "input_variables": [ 14 | { 15 | "name": "input", 16 | "description": "The scenario to turn into a poem.", 17 | "default": "" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/WriterPlugin/ShortPoem/skprompt.txt: -------------------------------------------------------------------------------- 1 | Generate a short funny poem or limerick to explain the given event. Be creative and be funny. Let your imagination run wild. 2 | Event:{{$input}} 3 | -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/WriterPlugin/StoryGen/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "description": "Generate a list of synopsis for a novel or novella with sub-chapters", 4 | "execution_settings": { 5 | "default": { 6 | "max_tokens": 250, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/WriterPlugin/StoryGen/skprompt.txt: -------------------------------------------------------------------------------- 1 | ONLY USE XML TAGS IN THIS LIST: 2 | [XML TAG LIST] 3 | list: Surround any lists with this tag 4 | synopsis: An outline of the chapter to write 5 | [END LIST] 6 | 7 | EMIT WELL FORMED XML ALWAYS. Code should be CDATA. 8 | 9 | 10 | {{$input}} 11 | -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/WriterPlugin/TellMeMore/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "description": "Summarize given text or any text document", 4 | "execution_settings": { 5 | "default": { 6 | "max_tokens": 500, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/WriterPlugin/TellMeMore/skprompt.txt: -------------------------------------------------------------------------------- 1 | >>>>>The following is part of a {{$conversationtype}}. 2 | {{$input}} 3 | 4 | >>>>>The following is an overview of a previous part of the {{$conversationtype}}, focusing on "{{$focusarea}}". 5 | {{$previousresults}} 6 | 7 | >>>>>In 250 words or less, write a verbose and detailed overview of the {{$conversationtype}} focusing solely on "{{$focusarea}}". -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/WriterPlugin/Translate/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "description": "Translate the input into a language of your choice", 4 | "execution_settings": { 5 | "default": { 6 | "max_tokens": 2000, 7 | "temperature": 0.7, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0, 11 | "stop_sequences": [ 12 | "[done]" 13 | ] 14 | } 15 | }, 16 | "input_variables": [ 17 | { 18 | "name": "input", 19 | "description": "Text to translate", 20 | "default": "" 21 | }, 22 | { 23 | "name": "language", 24 | "description": "Language to translate to", 25 | "default": "" 26 | } 27 | ] 28 | } -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/WriterPlugin/Translate/skprompt.txt: -------------------------------------------------------------------------------- 1 | Translate the input below into {{$language}} 2 | 3 | MAKE SURE YOU ONLY USE {{$language}}. 4 | 5 | {{$input}} 6 | 7 | Translation: 8 | -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/WriterPlugin/TwoSentenceSummary/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "description": "Summarize given text in two sentences or less", 4 | "execution_settings": { 5 | "default": { 6 | "max_tokens": 100, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/ChatbotV3/Plugins/WriterPlugin/TwoSentenceSummary/skprompt.txt: -------------------------------------------------------------------------------- 1 | Summarize the following text in two sentences or less. 2 | [BEGIN TEXT] 3 | {{$input}} 4 | [END TEXT] 5 | -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/Config/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "azure", 3 | "model": "Your Azure OpenAI model", 4 | "endpoint": "", 5 | "apikey": "", 6 | "org": "" 7 | } -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/EmailWriter/EmailPlugin.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.SemanticKernel; 2 | using System.ComponentModel; 3 | 4 | namespace SemanticKernelDemo.EmailWriter; 5 | public class EmailPlugin 6 | { 7 | [KernelFunction] 8 | [Description("Sends an email to a recipient.")] 9 | public async Task SendEmailAsync( 10 | Kernel kernel, 11 | [Description("Semicolon delimitated list of emails of the recipients")] string recipientEmails, 12 | string subject, 13 | string body 14 | ) 15 | { 16 | // Add logic to send an email using the recipientEmails, subject, and body 17 | // For now, we'll just print out a success message to the console 18 | await Task.Delay(10); 19 | Console.WriteLine($"Email sent to {recipientEmails}!"); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /DotNetConf2023Demo/SemanticKernelDemo/SemanticKernelDemo/Program.cs: -------------------------------------------------------------------------------- 1 | // See https://aka.ms/new-console-template for more information 2 | 3 | using SemanticKernelDemo.ChatbotV3; 4 | 5 | Console.WriteLine("Hello, World!"); 6 | 7 | await ChatbotDemoV3.Run(); -------------------------------------------------------------------------------- /GlobalAIBootcamp2025Demo/Demo1/Demo1.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net9.0 6 | enable 7 | enable 8 | 5c80f3c8-5729-48b5-ab88-8a0e2f05351d 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | Always 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /GlobalAIBootcamp2025Demo/Demo1/Program.cs: -------------------------------------------------------------------------------- 1 | // See https://aka.ms/new-console-template for more information 2 | 3 | using Demo1; 4 | using Microsoft.Extensions.Configuration; 5 | using Microsoft.Extensions.Hosting; 6 | using Shared; 7 | 8 | Console.WriteLine("Hello, World!"); 9 | var builder = Host.CreateApplicationBuilder(args); 10 | builder.Configuration 11 | .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) 12 | .AddUserSecrets(); 13 | 14 | var openAiOptions = Helpers.GetConfigurations(builder); 15 | 16 | using IHost host = builder.Build(); 17 | 18 | await ChatDemo.Run(openAiOptions); -------------------------------------------------------------------------------- /GlobalAIBootcamp2025Demo/Demo1/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "OpenAiOptions": { 3 | "Model": "", 4 | "Endpoint": "", 5 | "Key": "" 6 | } 7 | } -------------------------------------------------------------------------------- /GlobalAIBootcamp2025Demo/Demo2/Demo2.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net9.0 6 | enable 7 | enable 8 | 4d0688af-7bfc-4f42-bc62-5cac3c38ea94 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Always 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /GlobalAIBootcamp2025Demo/Demo2/Program.cs: -------------------------------------------------------------------------------- 1 | // See https://aka.ms/new-console-template for more information 2 | 3 | using Demo2; 4 | using Microsoft.Extensions.Configuration; 5 | using Microsoft.Extensions.Hosting; 6 | using Shared; 7 | 8 | Console.WriteLine("Hello, World!"); 9 | var builder = Host.CreateApplicationBuilder(args); 10 | builder.Configuration 11 | .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) 12 | .AddUserSecrets(); 13 | 14 | var openAiOptions = Helpers.GetConfigurations(builder); 15 | 16 | using IHost host = builder.Build(); 17 | 18 | await ChatDemo.Run(openAiOptions); -------------------------------------------------------------------------------- /GlobalAIBootcamp2025Demo/Demo2/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "OpenAiOptions": { 3 | "Model": "", 4 | "Endpoint": "", 5 | "Key": "" 6 | } 7 | } -------------------------------------------------------------------------------- /GlobalAIBootcamp2025Demo/Demo3/Program.cs: -------------------------------------------------------------------------------- 1 | // See https://aka.ms/new-console-template for more information 2 | using Demo3; 3 | using Microsoft.Extensions.Configuration; 4 | using Microsoft.Extensions.Hosting; 5 | using Shared; 6 | 7 | Console.WriteLine("Hello, World!"); 8 | var builder = Host.CreateApplicationBuilder(args); 9 | builder.Configuration 10 | .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) 11 | .AddUserSecrets(); 12 | 13 | var openAiOptions = Helpers.GetConfigurations(builder); 14 | 15 | using IHost host = builder.Build(); 16 | 17 | await ChatDemo.Run(openAiOptions); -------------------------------------------------------------------------------- /GlobalAIBootcamp2025Demo/Demo3/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "OpenAiOptions": { 3 | "Model": "", 4 | "Endpoint": "", 5 | "Key": "" 6 | }, 7 | "BingSearchOptions": { 8 | "Endpoint": "", 9 | "Key": "" 10 | } 11 | } -------------------------------------------------------------------------------- /GlobalAIBootcamp2025Demo/Demo4/Demo4.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net9.0 6 | enable 7 | enable 8 | 0d2e27bb-bff9-4862-ad9c-920310c893b0 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | Always 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /GlobalAIBootcamp2025Demo/Demo4/Program.cs: -------------------------------------------------------------------------------- 1 | // See https://aka.ms/new-console-template for more information 2 | 3 | using Demo4; 4 | using Microsoft.Extensions.Configuration; 5 | using Microsoft.Extensions.Hosting; 6 | using Shared; 7 | 8 | Console.WriteLine("Hello, World!"); 9 | var builder = Host.CreateApplicationBuilder(args); 10 | builder.Configuration 11 | .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) 12 | .AddUserSecrets(); 13 | 14 | var openAiOptions = Helpers.GetConfigurations(builder); 15 | 16 | using IHost host = builder.Build(); 17 | 18 | await ChatDemo.Run(openAiOptions); -------------------------------------------------------------------------------- /GlobalAIBootcamp2025Demo/Demo4/Sample.txt: -------------------------------------------------------------------------------- 1 | Semantic Kernel (SK) is an open-source SDK that enables developers to build and orchestrate complex AI workflows that involve natural language processing (NLP) and machine learning models. It provides a flexible platform for integrating AI capabilities such as semantic search, text summarization, and dialogue systems into applications. With SK, you can easily combine different AI services and models, define their relationships, and orchestrate interactions between them. -------------------------------------------------------------------------------- /GlobalAIBootcamp2025Demo/Demo4/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "OpenAiOptions": { 3 | "Model": "", 4 | "Endpoint": "", 5 | "Key": "" 6 | } 7 | } -------------------------------------------------------------------------------- /GlobalAIBootcamp2025Demo/Demo6/Demo6.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net9.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /GlobalAIBootcamp2025Demo/Demo6/EchoTool.cs: -------------------------------------------------------------------------------- 1 | using ModelContextProtocol.Server; 2 | using System.ComponentModel; 3 | 4 | namespace Demo6; 5 | [McpServerToolType] 6 | public static class EchoTool 7 | { 8 | [McpServerTool, Description("Echoes the message back to the client.")] 9 | public static string Echo(string message) => $"Hello from C#: {message}"; 10 | 11 | [McpServerTool, Description("Echoes in reverse the message sent by the client.")] 12 | public static string ReverseEcho(string message) => new string(message.Reverse().ToArray()); 13 | } -------------------------------------------------------------------------------- /GlobalAIBootcamp2025Demo/Demo6/Program.cs: -------------------------------------------------------------------------------- 1 | // See https://aka.ms/new-console-template for more information 2 | using Demo6; 3 | using Microsoft.Extensions.DependencyInjection; 4 | using Microsoft.Extensions.Hosting; 5 | using Microsoft.Extensions.Logging; 6 | 7 | 8 | var builder = Host.CreateApplicationBuilder(args); 9 | builder.Logging.AddConsole(consoleLogOptions => 10 | { 11 | // Configure all logs to go to stderr 12 | consoleLogOptions.LogToStandardErrorThreshold = LogLevel.Trace; 13 | }); 14 | 15 | builder.Services.AddHttpClient(); 16 | builder.Services.AddSingleton(); 17 | builder.Services 18 | .AddMcpServer() 19 | .WithStdioServerTransport() 20 | .WithToolsFromAssembly(); 21 | 22 | await builder.Build().RunAsync(); -------------------------------------------------------------------------------- /GlobalAIBootcamp2025Demo/Shared/BingSearchOptions.cs: -------------------------------------------------------------------------------- 1 | namespace Shared; 2 | public sealed class BingSearchOptions 3 | { 4 | public string Endpoint { get; set; } = string.Empty; 5 | public string Key { get; set; } = string.Empty; 6 | } 7 | -------------------------------------------------------------------------------- /GlobalAIBootcamp2025Demo/Shared/Helpers.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Configuration; 2 | using Microsoft.Extensions.Hosting; 3 | 4 | namespace Shared; 5 | public static class Helpers 6 | { 7 | public static OpenAiOptions GetConfigurations(HostApplicationBuilder hostApplicationBuilder) 8 | { 9 | var openAiOptions = hostApplicationBuilder.Configuration.GetSection(nameof(OpenAiOptions)).Get(); 10 | if (openAiOptions is null) 11 | { 12 | throw new InvalidOperationException("OpenAiOptions is null"); 13 | } 14 | 15 | return openAiOptions; 16 | } 17 | 18 | public static BingSearchOptions GetBingSearchOptions(HostApplicationBuilder hostApplicationBuilder) 19 | { 20 | var bingSearchOptions = hostApplicationBuilder.Configuration.GetSection(nameof(BingSearchOptions)).Get(); 21 | if (bingSearchOptions is null) 22 | { 23 | throw new InvalidOperationException("BingSearchOptions is null"); 24 | } 25 | 26 | return bingSearchOptions; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /GlobalAIBootcamp2025Demo/Shared/OpenAiOptions.cs: -------------------------------------------------------------------------------- 1 | namespace Shared; 2 | public sealed class OpenAiOptions 3 | { 4 | public string Model { get; set; } = string.Empty; 5 | public string Endpoint { get; set; } = string.Empty; 6 | public string Key { get; set; } = string.Empty; 7 | public string ProjectConnectionString { get; set; } = string.Empty; 8 | } 9 | -------------------------------------------------------------------------------- /GlobalAIBootcamp2025Demo/Shared/Shared.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /LlmDemos/ChatDemoV1/ChatDemoV1.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | c92e2205-c817-4546-b5ff-0855d603577b 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | Always 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /LlmDemos/ChatDemoV1/Program.cs: -------------------------------------------------------------------------------- 1 | // See https://aka.ms/new-console-template for more information 2 | 3 | using ChatDemoV1; 4 | using Microsoft.Extensions.Configuration; 5 | using Microsoft.Extensions.Hosting; 6 | using Shared; 7 | 8 | Console.WriteLine("Hello, World!"); 9 | var builder = Host.CreateApplicationBuilder(args); 10 | builder.Configuration 11 | .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) 12 | .AddUserSecrets(); 13 | 14 | var openAiOptions = Helpers.GetConfigurations(builder); 15 | 16 | using IHost host = builder.Build(); 17 | 18 | await ChatDemo.Run(openAiOptions); -------------------------------------------------------------------------------- /LlmDemos/ChatDemoV1/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "OpenAiOptions": { 3 | "Model": "", 4 | "Endpoint": "", 5 | "Key": "" 6 | } 7 | } -------------------------------------------------------------------------------- /LlmDemos/ChatDemoV2/ChatDemoV2.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Always 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | Exe 19 | net8.0 20 | enable 21 | enable 22 | 3d09ea28-6066-46e5-a23a-fef3ca5ab06c 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /LlmDemos/ChatDemoV2/Program.cs: -------------------------------------------------------------------------------- 1 | // See https://aka.ms/new-console-template for more information 2 | using ChatDemoV2; 3 | using Microsoft.Extensions.Configuration; 4 | using Microsoft.Extensions.Hosting; 5 | using Shared; 6 | 7 | Console.WriteLine("Hello, World!"); 8 | var builder = Host.CreateApplicationBuilder(args); 9 | builder.Configuration 10 | .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) 11 | .AddUserSecrets(); 12 | 13 | var openAiOptions = Helpers.GetConfigurations(builder); 14 | 15 | using IHost host = builder.Build(); 16 | 17 | await ChatDemo.Run(openAiOptions); -------------------------------------------------------------------------------- /LlmDemos/ChatDemoV2/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "OpenAiOptions": { 3 | "Model": "", 4 | "Endpoint": "", 5 | "Key": "" 6 | } 7 | } -------------------------------------------------------------------------------- /LlmDemos/ChatDemoV3/ChatDemoV3.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | cc21bd26-5f11-44ad-9cf4-b14e951bee59 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Always 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /LlmDemos/ChatDemoV3/Program.cs: -------------------------------------------------------------------------------- 1 | // See https://aka.ms/new-console-template for more information 2 | using ChatDemoV3; 3 | using Microsoft.Extensions.Configuration; 4 | using Microsoft.Extensions.Hosting; 5 | using Shared; 6 | 7 | Console.WriteLine("Hello, World!"); 8 | var builder = Host.CreateApplicationBuilder(args); 9 | builder.Configuration 10 | .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) 11 | .AddUserSecrets(); 12 | 13 | var openAiOptions = Helpers.GetConfigurations(builder); 14 | 15 | using IHost host = builder.Build(); 16 | 17 | await ChatDemo.Run(openAiOptions); -------------------------------------------------------------------------------- /LlmDemos/ChatDemoV3/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "OpenAiOptions": { 3 | "Model": "", 4 | "Endpoint": "", 5 | "Key": "" 6 | } 7 | } -------------------------------------------------------------------------------- /LlmDemos/ChatDemoV4/ChatDemoV4.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9db2e277-f3fc-4278-bae3-63a82e944df4 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Always 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /LlmDemos/ChatDemoV4/Program.cs: -------------------------------------------------------------------------------- 1 | // See https://aka.ms/new-console-template for more information 2 | 3 | using ChatDemoV4; 4 | using Microsoft.Extensions.Configuration; 5 | using Microsoft.Extensions.Hosting; 6 | using Shared; 7 | 8 | Console.WriteLine("Hello, World!"); 9 | var builder = Host.CreateApplicationBuilder(args); 10 | builder.Configuration 11 | .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) 12 | .AddUserSecrets(); 13 | 14 | var openAiOptions = Helpers.GetConfigurations(builder); 15 | var bingSearchOptions = Helpers.GetBingSearchOptions(builder); 16 | 17 | using IHost host = builder.Build(); 18 | 19 | await ChatDemo.Run(openAiOptions, bingSearchOptions); 20 | -------------------------------------------------------------------------------- /LlmDemos/ChatDemoV4/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "OpenAiOptions": { 3 | "Model": "", 4 | "Endpoint": "", 5 | "Key": "" 6 | }, 7 | "BingSearchOptions": { 8 | "Endpoint": "", 9 | "Key": "" 10 | } 11 | } -------------------------------------------------------------------------------- /LlmDemos/ChatDemoV5/Program.cs: -------------------------------------------------------------------------------- 1 | // See https://aka.ms/new-console-template for more information 2 | using ChatDemoV5; 3 | using Microsoft.Extensions.Configuration; 4 | using Microsoft.Extensions.Hosting; 5 | using Shared; 6 | 7 | Console.WriteLine("Hello, World!"); 8 | var builder = Host.CreateApplicationBuilder(args); 9 | builder.Configuration 10 | .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) 11 | .AddUserSecrets(); 12 | 13 | var openAiOptions = Helpers.GetConfigurations(builder); 14 | 15 | using IHost host = builder.Build(); 16 | 17 | await ChatDemo.Run(openAiOptions); 18 | -------------------------------------------------------------------------------- /LlmDemos/ChatDemoV5/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "OpenAiOptions": { 3 | "Model": "", 4 | "Endpoint": "", 5 | "Key": "" 6 | } 7 | } -------------------------------------------------------------------------------- /LlmDemos/ChatDemoV6/ChatDemoV6.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 74199a00-30ee-4806-9811-e3375a39e7af 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | Always 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /LlmDemos/ChatDemoV6/Program.cs: -------------------------------------------------------------------------------- 1 | // See https://aka.ms/new-console-template for more information 2 | using ChatDemoV6; 3 | using Microsoft.Extensions.Configuration; 4 | using Microsoft.Extensions.Hosting; 5 | using Shared; 6 | 7 | Console.WriteLine("Hello, World!"); 8 | var builder = Host.CreateApplicationBuilder(args); 9 | builder.Configuration 10 | .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) 11 | .AddUserSecrets(); 12 | 13 | var openAiOptions = Helpers.GetConfigurations(builder); 14 | 15 | using IHost host = builder.Build(); 16 | 17 | await ChatDemo.Run(openAiOptions); -------------------------------------------------------------------------------- /LlmDemos/ChatDemoV6/SampleOutput.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yanxiaodi/MyCodeSamples/f2d7a22a91bce1c5c5eb3f5b9943ce1e85d54f6f/LlmDemos/ChatDemoV6/SampleOutput.md -------------------------------------------------------------------------------- /LlmDemos/ChatDemoV6/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "OpenAiOptions": { 3 | "Model": "", 4 | "Endpoint": "", 5 | "Key": "" 6 | } 7 | } -------------------------------------------------------------------------------- /LlmDemos/Shared/BingSearchOptions.cs: -------------------------------------------------------------------------------- 1 | namespace Shared; 2 | public sealed class BingSearchOptions 3 | { 4 | public string Endpoint { get; set; } = string.Empty; 5 | public string Key { get; set; } = string.Empty; 6 | } 7 | -------------------------------------------------------------------------------- /LlmDemos/Shared/Helpers.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Configuration; 2 | using Microsoft.Extensions.Hosting; 3 | 4 | namespace Shared; 5 | public static class Helpers 6 | { 7 | public static OpenAiOptions GetConfigurations(HostApplicationBuilder hostApplicationBuilder) 8 | { 9 | var openAiOptions = hostApplicationBuilder.Configuration.GetSection(nameof(OpenAiOptions)).Get(); 10 | if (openAiOptions is null) 11 | { 12 | throw new InvalidOperationException("OpenAiOptions is null"); 13 | } 14 | 15 | return openAiOptions; 16 | } 17 | 18 | public static BingSearchOptions GetBingSearchOptions(HostApplicationBuilder hostApplicationBuilder) 19 | { 20 | var bingSearchOptions = hostApplicationBuilder.Configuration.GetSection(nameof(BingSearchOptions)).Get(); 21 | if (bingSearchOptions is null) 22 | { 23 | throw new InvalidOperationException("BingSearchOptions is null"); 24 | } 25 | 26 | return bingSearchOptions; 27 | } 28 | } -------------------------------------------------------------------------------- /LlmDemos/Shared/OpenAiOptions.cs: -------------------------------------------------------------------------------- 1 | namespace Shared; 2 | 3 | public sealed class OpenAiOptions 4 | { 5 | public string Model { get; set; } = string.Empty; 6 | public string Endpoint { get; set; } = string.Empty; 7 | public string Key { get; set; } = string.Empty; 8 | } 9 | -------------------------------------------------------------------------------- /LlmDemos/Shared/Shared.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/1.CreatingKernel.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.SemanticKernel; 2 | using Kernel = Microsoft.SemanticKernel.Kernel; 3 | 4 | namespace SemanticKernelDemo.App; 5 | internal static partial class GettingStarted 6 | { 7 | public static Kernel InstantiateKernel() 8 | { 9 | var builder = new Kernel.CreateBuilder(); 10 | var (model, azureEndpoint, apiKey, orgId) = Settings.LoadFromFile(); 11 | 12 | builder.WithAzureChatCompletionService(model, azureEndpoint, apiKey); 13 | var kernel = builder.Build(); 14 | 15 | Console.WriteLine("Hello, Azure OpenAI!"); 16 | return kernel; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/FunSkill/Excuses/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "description": "Turn a scenario into a creative or humorous excuse to send your boss", 4 | "type": "completion", 5 | "completion": { 6 | "max_tokens": 60, 7 | "temperature": 1, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | } 12 | } -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/FunSkill/Excuses/skprompt.txt: -------------------------------------------------------------------------------- 1 | Generate a creative reason or excuse for the given event. Be creative and be funny. Let your imagination run wild. 2 | 3 | Event:I am running late. 4 | Excuse:I was being held ransom by giraffe gangsters. 5 | 6 | Event:{{$input}} -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/FunSkill/Joke/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "description": "Generate a funny joke", 4 | "type": "completion", 5 | "completion": { 6 | "max_tokens": 1000, 7 | "temperature": 0.5, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | }, 12 | "input": { 13 | "parameters": [ 14 | { 15 | "name": "input", 16 | "description": "Joke subject", 17 | "defaultValue": "" 18 | }, 19 | { 20 | "name": "style", 21 | "description": "Joke style", 22 | "defaultValue": "" 23 | } 24 | ] 25 | } 26 | } -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/FunSkill/Joke/skprompt.txt: -------------------------------------------------------------------------------- 1 | WRITE EXACTLY ONE JOKE or HUMOROUS STORY ABOUT THE TOPIC BELOW 2 | 3 | JOKE MUST BE: 4 | - G RATED 5 | - WORKPLACE/FAMILY SAFE 6 | NO SEXISM, RACISM OR OTHER BIAS/BIGOTRY 7 | 8 | BE CREATIVE AND FUNNY. I WANT TO LAUGH. 9 | {{$style}} 10 | +++++ 11 | 12 | {{$input}} 13 | +++++ 14 | -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/FunSkill/Limerick/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "description": "Generate a funny limerick about a person", 4 | "type": "completion", 5 | "completion": { 6 | "max_tokens": 100, 7 | "temperature": 0.7, 8 | "top_p": 0, 9 | "presence_penalty": 0, 10 | "frequency_penalty": 0 11 | }, 12 | "input": { 13 | "parameters": [ 14 | { 15 | "name": "name", 16 | "description": "", 17 | "defaultValue": "Bob" 18 | }, 19 | { 20 | "name": "input", 21 | "description": "", 22 | "defaultValue": "Dogs" 23 | } 24 | ] 25 | } 26 | } -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/FunSkill/Limerick/skprompt.txt: -------------------------------------------------------------------------------- 1 | There was a young woman named Bright, 2 | Whose speed was much faster than light. 3 | She set out one day, 4 | In a relative way, 5 | And returned on the previous night. 6 | 7 | There was an odd fellow named Gus, 8 | When traveling he made such a fuss. 9 | He was banned from the train, 10 | Not allowed on a plane, 11 | And now travels only by bus. 12 | 13 | There once was a man from Tibet, 14 | Who couldn't find a cigarette 15 | So he smoked all his socks, 16 | and got chicken-pox, 17 | and had to go to the vet. 18 | 19 | There once was a boy named Dan, 20 | who wanted to fry in a pan. 21 | He tried and he tried, 22 | and eventually died, 23 | that weird little boy named Dan. 24 | 25 | Now write a very funny limerick about {{$name}}. 26 | {{$input}} 27 | Invent new facts their life. Must be funny. 28 | -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/SummarizeSkill/MakeAbstractReadable/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "type": "completion", 4 | "description": "Given a scientific white paper abstract, rewrite it to make it more readable", 5 | "completion": { 6 | "max_tokens": 4000, 7 | "temperature": 0.0, 8 | "top_p": 1.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 2.0 11 | } 12 | } -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/SummarizeSkill/MakeAbstractReadable/skprompt.txt: -------------------------------------------------------------------------------- 1 | {{$input}} 2 | 3 | == 4 | Summarize, using a user friendly, using simple grammar. Don't use subjects like "we" "our" "us" "your". 5 | == -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/SummarizeSkill/Notegen/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "type": "completion", 4 | "description": "Automatically generate compact notes for any text or text document.", 5 | "completion": { 6 | "max_tokens": 256, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | } 12 | } -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/SummarizeSkill/Notegen/skprompt.txt: -------------------------------------------------------------------------------- 1 | Analyze the following extract taken from a document. 2 | - Produce key points for memory. 3 | - Give memory a name. 4 | - Extract only points worth remembering. 5 | - Be brief. Conciseness is very important. 6 | - Use broken English. 7 | You will use this memory to analyze the rest of this document, and for other relevant tasks. 8 | 9 | [Input] 10 | My name is Macbeth. I used to be King of Scotland, but I died. My wife's name is Lady Macbeth and we were married for 15 years. We had no children. Our beloved dog Toby McDuff was a famous hunter of rats in the forest. 11 | My story was immortalized by Shakespeare in a play. 12 | +++++ 13 | Family History 14 | - Macbeth, King Scotland 15 | - Wife Lady Macbeth, No Kids 16 | - Dog Toby McDuff. Hunter, dead. 17 | - Shakespeare play 18 | 19 | [Input] 20 | [[{{$input}}]] 21 | +++++ 22 | -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/SummarizeSkill/Summarize/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "type": "completion", 4 | "description": "Summarize given text or any text document", 5 | "completion": { 6 | "max_tokens": 512, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | }, 12 | "input": { 13 | "parameters": [ 14 | { 15 | "name": "input", 16 | "description": "Text to summarize", 17 | "defaultValue": "" 18 | } 19 | ] 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/SummarizeSkill/Summarize/skprompt.txt: -------------------------------------------------------------------------------- 1 | [SUMMARIZATION RULES] 2 | DONT WASTE WORDS 3 | USE SHORT, CLEAR, COMPLETE SENTENCES. 4 | DO NOT USE BULLET POINTS OR DASHES. 5 | USE ACTIVE VOICE. 6 | MAXIMIZE DETAIL, MEANING 7 | FOCUS ON THE CONTENT 8 | 9 | [BANNED PHRASES] 10 | This article 11 | This document 12 | This page 13 | This material 14 | [END LIST] 15 | 16 | Summarize: 17 | Hello how are you? 18 | +++++ 19 | Hello 20 | 21 | Summarize this 22 | {{$input}} 23 | +++++ -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/SummarizeSkill/Topics/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "type": "completion", 4 | "description": "Analyze given text or document and extract key topics worth remembering", 5 | "completion": { 6 | "max_tokens": 128, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | } 12 | } -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/SummarizeSkill/Topics/skprompt.txt: -------------------------------------------------------------------------------- 1 | Analyze the following extract taken from a document and extract key topics. 2 | - Topics only worth remembering. 3 | - Be brief. Short phrases. 4 | - Can use broken English. 5 | - Conciseness is very important. 6 | - Topics can include names of memories you want to recall. 7 | - NO LONG SENTENCES. SHORT PHRASES. 8 | - Return in JSON 9 | [Input] 10 | My name is Macbeth. I used to be King of Scotland, but I died. My wife's name is Lady Macbeth and we were married for 15 years. We had no children. Our beloved dog Toby McDuff was a famous hunter of rats in the forest. 11 | My tragic story was immortalized by Shakespeare in a play. 12 | [Output] 13 | { 14 | "topics": [ 15 | "Macbeth", 16 | "King of Scotland", 17 | "Lady Macbeth", 18 | "Dog", 19 | "Toby McDuff", 20 | "Shakespeare", 21 | "Play", 22 | "Tragedy" 23 | ] 24 | } 25 | +++++ 26 | [Input] 27 | {{$input}} 28 | [Output] -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/WriterSkill/Acronym/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "type": "completion", 4 | "description": "Generate an acronym for the given concept or phrase", 5 | "completion": { 6 | "max_tokens": 100, 7 | "temperature": 0.5, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | } 12 | } -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/WriterSkill/AcronymGenerator/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "type": "completion", 4 | "description": "Given a request to generate an acronym from a string, generate an acronym and provide the acronym explanation.", 5 | "completion": { 6 | "max_tokens": 256, 7 | "temperature": 0.7, 8 | "top_p": 1.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0, 11 | "stop_sequences": [ 12 | "#" 13 | ] 14 | } 15 | } -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/WriterSkill/AcronymReverse/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "type": "completion", 4 | "description": "Given a single word or acronym, generate the expanded form matching the acronym letters.", 5 | "completion": { 6 | "max_tokens": 256, 7 | "temperature": 0.5, 8 | "top_p": 1.0, 9 | "presence_penalty": 0.8, 10 | "frequency_penalty": 0.0, 11 | "stop_sequences": [ 12 | "#END#" 13 | ] 14 | } 15 | } -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/WriterSkill/AcronymReverse/skprompt.txt: -------------------------------------------------------------------------------- 1 | # acronym: Devis 2 | Sentences matching the acronym: 3 | 1. Dragons Eat Very Interesting Snacks 4 | 2. Develop Empathy and Vision to Increase Success 5 | 3. Don't Expect Vampires In Supermarkets 6 | #END# 7 | 8 | # acronym: Christmas 9 | Sentences matching the acronym: 10 | 1. Celebrating Harmony and Respect in a Season of Togetherness, Merriment, and True joy 11 | 2. Children Have Real Interest Since The Mystery And Surprise Thrills 12 | 3. Christmas Helps Reduce Inner Stress Through Mistletoe And Sleigh excursions 13 | #END# 14 | 15 | # acronym: noWare 16 | Sentences matching the acronym: 17 | 1. No One Wants an App that Randomly Erases everything 18 | 2. Nourishing Oatmeal With Almond, Raisin, and Egg toppings 19 | 3. Notice Opportunity When Available and React Enthusiastically 20 | #END# 21 | 22 | Reverse the following acronym back to a funny sentence. Provide 3 examples. 23 | # acronym: {{$INPUT}} 24 | Sentences matching the acronym: 25 | -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/WriterSkill/Brainstorm/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "type": "completion", 4 | "description": "Given a goal or topic description generate a list of ideas", 5 | "completion": { 6 | "max_tokens": 2000, 7 | "temperature": 0.5, 8 | "top_p": 1.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0, 11 | "stop_sequences": ["##END##"] 12 | }, 13 | "input": { 14 | "parameters": [ 15 | { 16 | "name": "input", 17 | "description": "A topic description or goal.", 18 | "defaultValue": "" 19 | } 20 | ] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/WriterSkill/Brainstorm/skprompt.txt: -------------------------------------------------------------------------------- 1 | Must: brainstorm ideas and create a list. 2 | Must: use a numbered list. 3 | Must: only one list. 4 | Must: end list with ##END## 5 | Should: no more than 10 items. 6 | Should: at least 3 items. 7 | Topic: {{$INPUT}} 8 | Start. 9 | -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/WriterSkill/EmailGen/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "type": "completion", 4 | "description": "Write an email from the given bullet points", 5 | "completion": { 6 | "max_tokens": 256, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | } 12 | } -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/WriterSkill/EmailGen/skprompt.txt: -------------------------------------------------------------------------------- 1 | Rewrite my bullet points into complete sentences. Use a polite and inclusive tone. 2 | 3 | [Input] 4 | - Macbeth, King Scotland 5 | - Married, Wife Lady Macbeth, No Kids 6 | - Dog Toby McDuff. Hunter, dead. 7 | - Shakespeare play 8 | +++++ 9 | The story of Macbeth 10 | My name is Macbeth. I used to be King of Scotland, but I died. My wife's name is Lady Macbeth and we were married for 15 years. We had no children. Our beloved dog Toby McDuff was a famous hunter of rats in the forest. 11 | My story was immortalized by Shakespeare in a play. 12 | 13 | +++++ 14 | [Input] 15 | {{$input}} 16 | +++++ 17 | -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/WriterSkill/EmailTo/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "type": "completion", 4 | "description": "Turn bullet points into an email to someone, using a polite tone", 5 | "completion": { 6 | "max_tokens": 256, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | } 12 | } -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/WriterSkill/EmailTo/skprompt.txt: -------------------------------------------------------------------------------- 1 | Rewrite my bullet points into an email featuring complete sentences. Use a polite and inclusive tone. 2 | 3 | [Input] 4 | Toby, 5 | 6 | - Macbeth, King Scotland 7 | - Married, Wife Lady Macbeth, No Kids 8 | - Dog Toby McDuff. Hunter, dead. 9 | - Shakespeare play 10 | 11 | Thanks, 12 | Dexter 13 | 14 | +++++ 15 | Hi Toby, 16 | 17 | The story of Macbeth 18 | My name is Macbeth. I used to be King of Scotland, but I died. My wife's name is Lady Macbeth and we were married for 15 years. We had no children. Our beloved dog Toby McDuff was a famous hunter of rats in the forest. 19 | My story was immortalized by Shakespeare in a play. 20 | 21 | Thanks, 22 | Dexter 23 | 24 | +++++ 25 | [Input] 26 | {{$to}} 27 | {{$input}} 28 | 29 | Thanks, 30 | {{$sender}} 31 | +++++ 32 | -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/WriterSkill/EnglishImprover/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "type": "completion", 4 | "description": "Translate text to English and improve it", 5 | "completion": { 6 | "max_tokens": 3000, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | } 12 | } -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/WriterSkill/EnglishImprover/skprompt.txt: -------------------------------------------------------------------------------- 1 | I want you to act as an English translator, spelling corrector and improver. 2 | I will speak to you in any language and you will detect the language, translate it and answer in the corrected and improved version of my text, in English. 3 | I want you to replace my simplified A0-level words and sentences with more beautiful and elegant, upper level English words and sentences. 4 | Keep the meaning same, but make them more literary. 5 | I want you to only reply the correction, the improvements and nothing else, do not write explanations. 6 | 7 | Sentence: """ 8 | {{$INPUT}} 9 | """ 10 | 11 | Translation: 12 | -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/WriterSkill/NovelChapter/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "type": "completion", 4 | "description": "Write a chapter of a novel.", 5 | "completion": { 6 | "max_tokens": 2048, 7 | "temperature": 0.3, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | }, 12 | "input": { 13 | "parameters": [ 14 | { 15 | "name": "input", 16 | "description": "A synopsis of what the chapter should be about.", 17 | "defaultValue": "" 18 | }, 19 | { 20 | "name": "theme", 21 | "description": "The theme or topic of this novel.", 22 | "defaultValue": "" 23 | }, 24 | { 25 | "name": "previousChapter", 26 | "description": "The synopsis of the previous chapter.", 27 | "defaultValue": "" 28 | }, 29 | { 30 | "name": "chapterIndex", 31 | "description": "The number of the chapter to write.", 32 | "defaultValue": "" 33 | } 34 | ] 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/WriterSkill/NovelChapter/skprompt.txt: -------------------------------------------------------------------------------- 1 | [CONTEXT] 2 | 3 | THEME OF STORY: 4 | {{$theme}} 5 | 6 | PREVIOUS CHAPTER: 7 | {{$previousChapter}} 8 | 9 | [END CONTEXT] 10 | 11 | 12 | WRITE THIS CHAPTER USING [CONTEXT] AND 13 | CHAPTER SYNOPSIS. DO NOT REPEAT SYNOPSIS IN THE OUTPUT 14 | 15 | Chapter Synopsis: 16 | {{$input}} 17 | 18 | Chapter {{$chapterIndex}} 19 | 20 | 21 | -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/WriterSkill/NovelChapterWithNotes/skprompt.txt: -------------------------------------------------------------------------------- 1 | [CONTEXT] 2 | 3 | THEME OF STORY: 4 | {{$theme}} 5 | 6 | NOTES OF STORY SO FAR - USE AS REFERENCE 7 | {{$notes}} 8 | 9 | PREVIOUS CHAPTER, USE AS REFERENCE: 10 | {{$previousChapter}} 11 | 12 | [END CONTEXT] 13 | 14 | 15 | WRITE THIS CHAPTER CONTINUING STORY, USING [CONTEXT] AND CHAPTER SYNOPSIS BELOW. DO NOT REPEAT SYNOPSIS IN THE CHAPTER. DON'T REPEAT PREVIOUS CHAPTER. 16 | 17 | {{$input}} 18 | 19 | Chapter {{$chapterIndex}} 20 | -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/WriterSkill/NovelOutline/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "type": "completion", 4 | "description": "Generate a list of chapter synopsis for a novel or novella", 5 | "completion": { 6 | "max_tokens": 2048, 7 | "temperature": 0.1, 8 | "top_p": 0.5, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | }, 12 | "input": { 13 | "parameters": [ 14 | { 15 | "name": "input", 16 | "description": "What the novel should be about.", 17 | "defaultValue": "" 18 | }, 19 | { 20 | "name": "chapterCount", 21 | "description": "The number of chapters to generate.", 22 | "defaultValue": "" 23 | }, 24 | { 25 | "name": "endMarker", 26 | "description": "The marker to use to end each chapter.", 27 | "defaultValue": "" 28 | } 29 | ] 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/WriterSkill/NovelOutline/skprompt.txt: -------------------------------------------------------------------------------- 1 | I want to write a {{$chapterCount}} chapter novella about: 2 | {{$input}} 3 | 4 | There MUST BE {{$chapterCount}} CHAPTERS. 5 | 6 | INVENT CHARACTERS AS YOU SEE FIT. BE HIGHLY CREATIVE AND/OR FUNNY. 7 | WRITE SYNOPSIS FOR EACH CHAPTER. INCLUDE INFORMATION ABOUT CHARACTERS ETC. SINCE EACH 8 | CHAPTER WILL BE WRITTEN BY A DIFFERENT WRITER, YOU MUST INCLUDE ALL PERTINENT INFORMATION 9 | IN EACH SYNOPSIS 10 | 11 | YOU MUST END EACH SYNOPSIS WITH {{$endMarker}} 12 | 13 | -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/WriterSkill/Rewrite/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "type": "completion", 4 | "description": "Automatically generate compact notes for any text or text document", 5 | "completion": { 6 | "max_tokens": 256, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | } 12 | } -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/WriterSkill/Rewrite/skprompt.txt: -------------------------------------------------------------------------------- 1 | Rewrite the given text like it was written in this style or by: {{$style}}. 2 | MUST RETAIN THE MEANING AND FACTUAL CONTENT AS THE ORIGINAL. 3 | 4 | 5 | {{$input}} 6 | 7 | -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/WriterSkill/ShortPoem/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "type": "completion", 4 | "description": "Turn a scenario into a short and entertaining poem.", 5 | "completion": { 6 | "max_tokens": 60, 7 | "temperature": 0.5, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | }, 12 | "input": { 13 | "parameters": [ 14 | { 15 | "name": "input", 16 | "description": "The scenario to turn into a poem.", 17 | "defaultValue": "" 18 | } 19 | ] 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/WriterSkill/ShortPoem/skprompt.txt: -------------------------------------------------------------------------------- 1 | Generate a short funny poem or limerick to explain the given event. Be creative and be funny. Let your imagination run wild. 2 | Event:{{$input}} 3 | -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/WriterSkill/StoryGen/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "type": "completion", 4 | "description": "Generate a list of synopsis for a novel or novella with sub-chapters", 5 | "completion": { 6 | "max_tokens": 250, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/WriterSkill/StoryGen/skprompt.txt: -------------------------------------------------------------------------------- 1 | ONLY USE XML TAGS IN THIS LIST: 2 | [XML TAG LIST] 3 | list: Surround any lists with this tag 4 | synopsis: An outline of the chapter to write 5 | [END LIST] 6 | 7 | EMIT WELL FORMED XML ALWAYS. Code should be CDATA. 8 | 9 | 10 | {{$input}} 11 | -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/WriterSkill/TellMeMore/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "type": "completion", 4 | "description": "Summarize given text or any text document", 5 | "completion": { 6 | "max_tokens": 500, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | } 12 | } -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/WriterSkill/TellMeMore/skprompt.txt: -------------------------------------------------------------------------------- 1 | >>>>>The following is part of a {{$conversationtype}}. 2 | {{$input}} 3 | 4 | >>>>>The following is an overview of a previous part of the {{$conversationtype}}, focusing on "{{$focusarea}}". 5 | {{$previousresults}} 6 | 7 | >>>>>In 250 words or less, write a verbose and detailed overview of the {{$conversationtype}} focusing solely on "{{$focusarea}}". -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/WriterSkill/Translate/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "type": "completion", 4 | "description": "Translate the input into a language of your choice", 5 | "completion": { 6 | "max_tokens": 2000, 7 | "temperature": 0.7, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0, 11 | "stop_sequences": [ 12 | "[done]" 13 | ] 14 | } 15 | } -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/WriterSkill/Translate/skprompt.txt: -------------------------------------------------------------------------------- 1 | Translate the input below into {{$language}} 2 | 3 | MAKE SURE YOU ONLY USE {{$language}}. 4 | 5 | {{$input}} 6 | 7 | Translation: 8 | -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/WriterSkill/TwoSentenceSummary/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "type": "completion", 4 | "description": "Summarize given text in two sentences or less", 5 | "completion": { 6 | "max_tokens": 100, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | } 12 | } -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Plugins/WriterSkill/TwoSentenceSummary/skprompt.txt: -------------------------------------------------------------------------------- 1 | Summarize the following text in two sentences or less. 2 | [BEGIN TEXT] 3 | {{$input}} 4 | [END TEXT] 5 | -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Program.cs: -------------------------------------------------------------------------------- 1 | // See https://aka.ms/new-console-template for more information 2 | using SemanticKernelDemo.App; 3 | 4 | Console.WriteLine("Hello, World!"); 5 | 6 | // Instantiate a kernel 7 | var kernel = GettingStarted.InstantiateKernel(); 8 | 9 | // Load a plugin from a directory 10 | await kernel.LoadPluginFromFiles(); 11 | 12 | // Load a plugin from inline code 13 | //await kernel.LoadPluginFromInline(); 14 | 15 | // Set context variables 16 | //await kernel.SetContextVariables(); 17 | 18 | // Use the planner 19 | //await kernel.UsePlanner(); 20 | 21 | // Use the planner with an additional function 22 | //await kernel.UsePlannerWithAdditionalFunction(); 23 | 24 | -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/SemanticKernelDemo.App.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Always 17 | 18 | 19 | Always 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/Utils.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | 3 | // ReSharper disable InconsistentNaming 4 | using System.Text; 5 | 6 | public static class Utils 7 | { 8 | // Function used to wrap long lines of text 9 | public static string WordWrap(string text, int maxLineLength) 10 | { 11 | var result = new StringBuilder(); 12 | int i; 13 | var last = 0; 14 | var space = new[] { ' ', '\r', '\n', '\t' }; 15 | do 16 | { 17 | i = last + maxLineLength > text.Length 18 | ? text.Length 19 | : (text.LastIndexOfAny(new[] { ' ', ',', '.', '?', '!', ':', ';', '-', '\n', '\r', '\t' }, Math.Min(text.Length - 1, last + maxLineLength)) + 1); 20 | if (i <= last) i = Math.Min(last + maxLineLength, text.Length); 21 | result.AppendLine(text.Substring(last, i - last).Trim(space)); 22 | last = i; 23 | } while (i < text.Length); 24 | 25 | return result.ToString(); 26 | } 27 | } -------------------------------------------------------------------------------- /OpenAILab2023/sk-demo/SemanticKernelDemo/SemanticKernelDemo.App/config/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": "gpt-4", 3 | "endpoint": "https://welly-openai-lab.openai.azure.com/", 4 | "apikey": "", 5 | "org": "" 6 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MyCodeSamples 2 | Some demos in my blogs. 3 | 4 | * [4 ways to generate code in C# — Including Source Generators in .NET 5](https://levelup.gitconnected.com/four-ways-to-generate-code-in-c-including-source-generators-in-net-5-9e6817db425): [CodeGeneratorDemo](https://github.com/yanxiaodi/MyCodeSamples/tree/main/CodeGeneratorDemo) 5 | 6 | 7 | -------------------------------------------------------------------------------- /SeasonOfAICopilot/PodcastAppAPI/PodcastAppAPI/.config/dotnet-tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "isRoot": true, 4 | "tools": { 5 | "swashbuckle.aspnetcore.cli": { 6 | "version": "6.6.2", 7 | "commands": [ 8 | "swagger" 9 | ], 10 | "rollForward": false 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /SeasonOfAICopilot/PodcastAppAPI/PodcastAppAPI/AppConfigurationOptions.cs: -------------------------------------------------------------------------------- 1 | namespace PodcastAppAPI; 2 | 3 | internal sealed class OpenAiOptions 4 | { 5 | public string Endpoint { get; set; } = string.Empty; 6 | public string Key { get; set; } = string.Empty; 7 | } 8 | 9 | internal sealed class BingSearchOptions 10 | { 11 | public string Endpoint { get; set; } = string.Empty; 12 | public string Key { get; set; } = string.Empty; 13 | } 14 | -------------------------------------------------------------------------------- /SeasonOfAICopilot/PodcastAppAPI/PodcastAppAPI/IPodcastCopilot.cs: -------------------------------------------------------------------------------- 1 | namespace PodcastAppAPI; 2 | 3 | public interface IPodcastCopilot 4 | { 5 | Task GenerateSocialMediaPost(string podcastUrl); 6 | } 7 | -------------------------------------------------------------------------------- /SeasonOfAICopilot/PodcastAppAPI/PodcastAppAPI/PodcastAppAPI.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | b78a2c0b-f207-4899-aa60-dd3e0b6b81e8 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /SeasonOfAICopilot/PodcastAppAPI/PodcastAppAPI/PodcastAppAPI.http: -------------------------------------------------------------------------------- 1 | @PodcastAppAPI_HostAddress = http://localhost:5173 2 | 3 | GET {{PodcastAppAPI_HostAddress}}/weatherforecast/ 4 | Accept: application/json 5 | 6 | ### 7 | -------------------------------------------------------------------------------- /SeasonOfAICopilot/PodcastAppAPI/PodcastAppAPI/Properties/serviceDependencies.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "CustomConnector": { 4 | "type": "powerplatform" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /SeasonOfAICopilot/PodcastAppAPI/PodcastAppAPI/Properties/serviceDependencies.local.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "CustomConnector": { 4 | "connectionInfo": "Custom Connector: PodcastCopilot_Connector (Environment: Xiaodi Yan's Environment)", 5 | "connectorName": "PodcastCopilot_Connector", 6 | "environmentUrl": "https://org1b089e50.crm.dynamics.com/", 7 | "environmentId": "a1972a66-9ad3-e56f-a985-20a1b9bf820e", 8 | "type": "powerplatform.local" 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /SeasonOfAICopilot/PodcastAppAPI/PodcastAppAPI/SocialMediaPost.cs: -------------------------------------------------------------------------------- 1 | namespace PodcastAppAPI; 2 | 3 | public class SocialMediaPost 4 | { 5 | public string ImageUrl { get; set; } = string.Empty; 6 | public string Blurb { get; set; } = string.Empty; 7 | } 8 | -------------------------------------------------------------------------------- /SeasonOfAICopilot/PodcastAppAPI/PodcastAppAPI/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /SeasonOfAICopilot/PodcastAppAPI/PodcastAppAPI/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*", 9 | "OpenAiOptions": { 10 | "Endpoint": "", 11 | "Key": "" 12 | }, 13 | "BingSearchOptions": { 14 | "Endpoint": "", 15 | "Key": "" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /SeasonOfAIDemo/SeasonOfAIDemo/AutoGenDemo/AutoGenDemo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 24bd2c5e-cecb-4d35-a007-942b42bff7c0 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | Always 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /SeasonOfAIDemo/SeasonOfAIDemo/AutoGenDemo/OpenAiOptions.cs: -------------------------------------------------------------------------------- 1 | namespace AutoGenDemo; 2 | internal sealed class OpenAiOptions 3 | { 4 | public string Model { get; set; } = string.Empty; 5 | public string Endpoint { get; set; } = string.Empty; 6 | public string Key { get; set; } = string.Empty; 7 | } 8 | 9 | internal sealed class BingSearchOptions 10 | { 11 | public string Endpoint { get; set; } = string.Empty; 12 | public string Key { get; set; } = string.Empty; 13 | } 14 | 15 | internal sealed class AzureAiSearchOptions 16 | { 17 | public string Endpoint { get; set; } = string.Empty; 18 | public string Key { get; set; } = string.Empty; 19 | public string Index { get; set; } = string.Empty; 20 | } -------------------------------------------------------------------------------- /SeasonOfAIDemo/SeasonOfAIDemo/AutoGenDemo/Program.cs: -------------------------------------------------------------------------------- 1 | // See https://aka.ms/new-console-template for more information 2 | 3 | using AutoGenDemo; 4 | using Microsoft.Extensions.Configuration; 5 | using Microsoft.Extensions.Hosting; 6 | 7 | Console.WriteLine("Hello, Wellington .NET User Group! Welcome to join Season of AI!"); 8 | 9 | var builder = Host.CreateApplicationBuilder(args); 10 | builder.Configuration 11 | .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) 12 | .AddUserSecrets(); 13 | 14 | var (openAiOptions, bingSearchOptions, azureAiSearchOptions) = Helpers.GetConfigurations(builder); 15 | 16 | using IHost host = builder.Build(); 17 | 18 | //await ChatWithAssistantAgent.Run(openAiOptions); 19 | await ChatWithSemanticKernelAgent.Run(openAiOptions, bingSearchOptions); 20 | 21 | 22 | await host.RunAsync(); -------------------------------------------------------------------------------- /SeasonOfAIDemo/SeasonOfAIDemo/AutoGenDemo/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "OpenAiOptions": { 3 | "Model": "", 4 | "Endpoint": "", 5 | "Key": "" 6 | }, 7 | "BingSearchOptions": { 8 | "Endpoint": "", 9 | "Key": "" 10 | }, 11 | "AzureAiSearchOptions": { 12 | "Endpoint": "", 13 | "Key": "", 14 | "Index": "" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /SeasonOfAIDemo/SeasonOfAIDemo/SeasonOfAIDemo/OpenAiOptions.cs: -------------------------------------------------------------------------------- 1 | namespace SeasonOfAIDemo; 2 | internal sealed class OpenAiOptions 3 | { 4 | public string Model { get; set; } = string.Empty; 5 | public string Endpoint { get; set; } = string.Empty; 6 | public string Key { get; set; } = string.Empty; 7 | } 8 | 9 | internal sealed class BingSearchOptions 10 | { 11 | public string Endpoint { get; set; } = string.Empty; 12 | public string Key { get; set; } = string.Empty; 13 | } 14 | 15 | internal sealed class AzureAiSearchOptions 16 | { 17 | public string Endpoint { get; set; } = string.Empty; 18 | public string Key { get; set; } = string.Empty; 19 | public string Index { get; set; } = string.Empty; 20 | } -------------------------------------------------------------------------------- /SeasonOfAIDemo/SeasonOfAIDemo/SeasonOfAIDemo/Program.cs: -------------------------------------------------------------------------------- 1 | // See https://aka.ms/new-console-template for more information 2 | 3 | using Microsoft.Extensions.Configuration; 4 | using Microsoft.Extensions.Hosting; 5 | using SeasonOfAIDemo; 6 | using SeasonOfAIDemo.ChatV1; 7 | 8 | Console.WriteLine("Hello, Wellington .NET User Group! Welcome to join Season of AI!"); 9 | 10 | var builder = Host.CreateApplicationBuilder(args); 11 | builder.Configuration 12 | .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) 13 | .AddUserSecrets(); 14 | 15 | var (openAiOptions, bingSearchOptions, azureAiSearchOptions) = Helpers.GetConfigurations(builder); 16 | 17 | using IHost host = builder.Build(); 18 | 19 | // Application code should start here. 20 | 21 | await ChatDemoV1.Run(openAiOptions); 22 | //await ChatDemoV2.Run(openAiOptions); 23 | //await ChatDemoV3.Run(openAiOptions, bingSearchOptions); 24 | //await ChatDemoV4.Run(openAiOptions, azureAiSearchOptions); 25 | 26 | await host.RunAsync(); 27 | 28 | -------------------------------------------------------------------------------- /SeasonOfAIDemo/SeasonOfAIDemo/SeasonOfAIDemo/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "OpenAiOptions": { 3 | "Model": "", 4 | "Endpoint": "", 5 | "Key": "" 6 | }, 7 | "BingSearchOptions": { 8 | "Endpoint": "", 9 | "Key": "" 10 | }, 11 | "AzureAiSearchOptions": { 12 | "Endpoint": "", 13 | "Key": "", 14 | "Index": "" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /WebApiClientDemo/WebApiClientDemo/WebApiClientDemo.Client/IWebApiClient.cs: -------------------------------------------------------------------------------- 1 | namespace WebApiClientDemo.Client; 2 | 3 | public interface IWebApiClient 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /WebApiClientDemo/WebApiClientDemo/WebApiClientDemo.Client/WebApiClientOptions.cs: -------------------------------------------------------------------------------- 1 | namespace WebApiClientDemo.Client; 2 | public class WebApiClientOptions 3 | { 4 | public string? BaseUrl { get; set; } 5 | } 6 | -------------------------------------------------------------------------------- /WebApiClientDemo/WebApiClientDemo/WebApiClientDemo/.config/dotnet-tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "isRoot": true, 4 | "tools": { 5 | "swashbuckle.aspnetcore.cli": { 6 | "version": "6.5.0", 7 | "commands": [ 8 | "swagger" 9 | ] 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /WebApiClientDemo/WebApiClientDemo/WebApiClientDemo/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace WebApiClientDemo; 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 | -------------------------------------------------------------------------------- /WebApiClientDemo/WebApiClientDemo/WebApiClientDemo/WebApiClientDemo.http: -------------------------------------------------------------------------------- 1 | @WebApiClientDemo_HostAddress = http://localhost:5135 2 | 3 | GET {{WebApiClientDemo_HostAddress}}/weatherforecast/ 4 | Accept: application/json 5 | 6 | ### 7 | -------------------------------------------------------------------------------- /WebApiClientDemo/WebApiClientDemo/WebApiClientDemo/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /WebApiClientDemo/WebApiClientDemo/WebApiClientDemo/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | --------------------------------------------------------------------------------