Category: .NET

  • Exchange rates–what I have done in 37 hours–part 38

    What I have create for now in 37 hours : A source control – https://github.com/ignatandrei/InfoValutar A plugin based software – you can use to load any kind of exchange rates,for anywhere,provided that you implement the interface – see implementation Tests for some of the code Deployment: An Azure WebAPP  WebAPI deployment  – https://infovalutar.azurewebsites.net/swagger/index.html A Docker…

  • C# WebAPI and NotFound with message in MVC .NET 4.5

    Usually,WEBAPI should return correct HTML status code ( read also https://damienfremont.com/2017/11/23/rest-api-maturity-levels-from-0-to-5/ ) . Let’s say we are saving an entity  – the OK result could return a meaningful message. How about querying for an id that you cannot find ? Easy: NotFound :  .But –the NotFound does NOT show an message. How a client can make…

  • Use the right language for the job–if you know

    Many years ago I have done a site that lists the exchange rates from BNR and BCE ( www.infovalutar.ro ). It reads the exchanges from BNR html page and then put into a database. The use is for programmers – there are many methods to find latest exchange rates ( RSS,SOAP,url,by MVC,JSON… –  see  all…

  • Dotnet Try

    I have wrote a blog post about DotNet CLI Tools I did not mention one that is super important: DotNet Try : https://github.com/dotnet/try You can see at https://github.com/dotnet/try how to install it . Or,to use in Docker,check my files to install in Docker https://github.com/ignatandrei/Presentations/tree/master/2019/shorts/NetCoreGlobalTools/dotnetTry   . To edit files in Docker,use Visual Studio Code with Docker and Remote Development and Docker extension.…

  • [PostEvent] Talks by Softbinator

    The organizers from Talk from Softbinator were kind enough to select me for a presentation. Again,my presentation about .NET Core and Angular Everywhere. Source Code at https://github.com/ignatandrei/angNetCoreDemo/  The presentation was supposed to take 1/2 hour – and it took 1 hour with all the explanations. Video at https://www.facebook.com/softbinator/videos/459024768242391

  • Correct abstraction–.NET Core IFileProvider

    Create the right abstraction and they will implement it. I was delighted by finding that the .NET Core has an IFileProvider : https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.fileproviders.ifileprovider?view=aspnetcore-2.2  . An obvious implementation is PhysicalFileProvider : https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.fileproviders.physicalfileprovider?view=aspnetcore-2.2 A not so obvious implementation,but normal from a programmers mind,is NullFileProvider: https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.fileproviders.nullfileprovider?view=aspnetcore-2.2 And,because we have already 2 providers,makes sense a CompositeFileProvider: https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.fileproviders.compositefileprovider?view=aspnetcore-2.2 And because…

  • Simple serialize of encoding

    My problem was the serialize of the Encoding . Let’s suppose that we have a class that have a property Encoding( maybe to read a file ). We want to serialize this class in order to let the administrator/people to decide what will be the encoding. When we serialize( obvious,with NewtonSoftJson),we obtain this kind of…

  • C# integration testing in AzureDevOps with Docker containers– SqlServer and Cachet example

    Every software that we make depends on others. For Stankins,as a general ETL data,it is more important to be tested with real data providers.For example,we may want to take data from Sql Server and send to Cachet . How can we have a SqlServer and a Cachet up and running easy ? The obvious answer…

  • Create a new exception–add fields and/or properties

    This post is not about why we need custom exception (https://blogs.msdn.microsoft.com/jaredpar/2008/10/20/custom-exceptions-when-should-you-create-them/ ) . It is (more a rant ) about a specific  item in best practices in Exceptions( https://docs.microsoft.com/en-us/dotnet/standard/exceptions/best-practices-for-exceptions ) It says: In custom exceptions,provide additional properties as needed Provide additional properties for an exception (in addition to the custom message string) only when there’s…

  • OpenSource library- publishing

    Following the rules at https://docs.microsoft.com/en-us/dotnet/standard/library-guidance/publish-nuget-package Nr Recomandation AOP Roslyn 1 DO publish stable packages and pre-release packages you want community feedback on to NuGet.org. Done 2 CONSIDER publishing pre-release packages to a MyGet feed from a continuous integration build. No 3 CONSIDER testing packages in your development environment using a local feed or MyGet. Check…