• Try Dot Net–again–part 32

    I wanted to put my project on the .NET try – it is a wonderful tool that makes magic for .NET . However,I wanted to be in a docker container. I have open a issue here: https://github.com/dotnet/try/issues/590 It was resolved  – now I can specify the port But the problem now it is that cannot…

  • Friday Links 350

    Exploring Histograms Aspect Oriented Programming in C# using DispatchProxy – CodeProject Aspect-Oriented Programming – Aspect-Oriented Programming with the RealProxy Class krlmlr/here: A simple interface to rprojroot kannan-ar/MariGold.OpenXHTML: MariGold.OpenXHTML is a wrapper library for Open XML SDK to convert HTML documents into Open XML word documents. AngleSharp/AngleSharp: The ultimate angle brackets parser library parsing HTML5,MathML,SVG and…

  • Saving multiple data–part 31

    I want to load the exchange rates from NBR and ECB and load at once .From here,the challenges of programming for a simple task like this: How we can display the errors ? What if the data exists already for this day and I cannot save into database,because it exists ? How to acknowledge what…

  • 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…

I am ok , you are ok