-
EF Core identical tables and partial–part 30
Let’s suppose that you have 2 identical tables and you scaffold from the context the tables. It will give you 2 classes – with the same properties. How can you make to work for the programmer as the same class,without modifying the models scaffolded by EF ? Example – class Ecb and class Nbr from…
-
Middleware for custom urls–part 29
The question was how I can now intercept calls like www.infovalutar.ro/bnr/2004/10/10/EUR www.infovalutar.ro/bnr/azi/eur www.infovalutar.ro/2004/6/4/eur.bnr http://www.infovalutar.ro/bnr/rss ? There is no controller ! So – middleware to help! For reading about middleware,please see https://docs.microsoft.com/en-us/aspnet/core/fundamentals/middleware/?view=aspnetcore-3.0 For rewriting,please see https://docs.microsoft.com/en-us/aspnet/core/fundamentals/url-rewriting?view=aspnetcore-3.0 Anyway,this is my code: var service = app.ApplicationServices.GetService<LoadExchangeProviders>(); foreach (var item in service.Banks()) { app.MapWhen(cnt => cnt.Request.Path.Value.StartsWith(“/” + item +…
-
Refactoring,AzureConnectionString,rss,asmx–part 28
Now,I want to see that I can read from the database the exchange rates. For this,in Azure WebAPP I go to Settings => Configuration and add my connection string. But now I have a problem: I must read from the configuration. So back on DI with InMemory class – I inject from ASP.NET Core the…
-
Friday Links 349
Ex-Microsoft exec Julie Larson-Green shares her secrets on building great teams | On MSFT Why big data projects fail (and what you can do about it) Think About Your API Client Exploring the .NET Core Docker files: dotnet vs aspnetcore vs aspnetcore-build AOP – Method and property interception in C# – CodeProject Front-End Tools: My…
-
In memory or sql–part 27
When I want to perform tests,the SqlServer in memory is enough good. But,when in production,should have a proper connection string. So I figured a simple way to understand this: if no connection string in appsettings.json,then use InMemory Sql Server . If there is,it should be a read connection string. First,I have tried with ConfigurationManager.ConnectionStrings[“DBWrite”]; –…
-
Adding database in Azure –part 26
Now getting the database – needed for historic data. When I go to Create New Database in Azure Portal,there are many types of Database (mongo,postgres,many others) – the easy choice,for me,is SqlServer ( even if the tables are not be updated – the exchange rates does not change a lot). There is something that is…
-
Code Coverage–part 25
Install coverlet and report generator dotnet tool install coverlet.console dotnet tool install dotnet-reportgenerator-globaltool Then dotnet coverlet Infovalutar.sln –target “dotnet” –targetargs “test InfovalutarTest\InfovalutarTest.csproj –configuration release –no-build” –format opencover –exclude “[xunit*]*” dotnet reportgenerator “-reports:coverage.opencover.xml” “-targetdir:coveragereport” “-reporttypes:HTMLInline;HTMLSummary;Badges” And the result ?No assemblies have been covered. Updating all NuGet packages for the solution – including a collector…
-
Friday Links 348
huyingjie/Awesome-shiny-apps-for-statistics: <�� A curated list of Awesome Shiny Apps for Statistics (ASAS)<�� Six Reasons To Learn R For Business sharlagelfand/toronto-sexual-health-clinics Combined outlier detection with dplyr and ruler Time Series Forecasting with Recurrent Neural Networks Pipes in R Tutorial For Beginners – R-posts.com More Pipes in R – Win-Vector Blog DateTime Best Practices | Complete Developer…
-
See the tests in VSCode and improvements in powershell–part 24
I wanted that the user can see the tests when running in VSCode. So in devcontainer.json I have put “extensions”: [ “ms-vscode.csharp” “ms-vscode.csharp”, “hbenl.vscode-test-explorer”, “formulahendry.dotnet-test-explorer” ] and in the settings.json on .vscode folder dotnet-test-explorer.enableTelemetry”: false, “dotnet-test-explorer.testProjectPath”:”**/*.sln”, “dotnet-test-explorer.autoExpandTree”:true So far,so good. But – I remember that powershell have a problem. And I figure why…
-
Deploy to Azure–part 23
Create in Azure an AppService infovalutar with InfovalutarRG resource group – can be done like here https://docs.microsoft.com/en-us/azure/app-service/app-service-web-get-started-dotnet or from the Azure Portal ( create AppService – I have put Linux with .NET Core 3.0) Searching how to connect AzureDevOps – the connection should be added from Project Settings (a link at the bottom of the…
I am ok , you are ok