Category: .NET

  • Execute SqlServer scripts at startup – Aspire 9.1 vs Aspire 9.2

    One of the usual things in Software development is creating the database with all the tables,views,stored procedures and anything related . For Aspire 9.1 with Sql Ser,this involved a coordination between some shell scripts – see the code : The scripts where in the mount binding. Also,some .gitattributes files was required with to can execute…

  • NetCoreUsefullEndpoints-part 14–adding roles and claims and authorization

    I have added the current user role and claims to the nuget Usefull Endpoints for .NET Core  .  The endpoints are api/usefull/user/isInRole/{roleName} and api/usefull/user/claims/simple and api/usefull/user/authorization For the first one the code is pretty simple For claims and authorization,please see code at ignatandrei/NetCoreUsefullEndpoints: Usefull Endpoints for .NET Core

  • Aspire 9.x add sql server database viewer

    .NET Aspire is a formidable tool to visualize your components and relation between them . Today I will show you how to add a custom visualizer for SqlServer database . The code for adding a database is pretty simple     The community extension,https://github.com/CommunityToolkit/Aspire,has already an extension,WithDBGate,that adds a viewer for the whole SqlServer .…

  • Demeter and Roslyn–part 3–config and tests

    Beyond the Squiggles: Flexible Reporting and Confidence Through Testing So,we’ve built our Law of Demeter analyzer,RSCG_Demeter,using Roslyn to intelligently spot those overly-chatty code chains,even navigating the complexities of fluent interfaces. We could just have it throw warnings or errors directly in your IDE via Roslyn diagnostics. But let’s be honest,sometimes a flood of new diagnostics…

  • Demeter and Roslyn–part 2- code

    Okay,let’s build on the first part and explain the “how” in a more engaging way,weaving in the code snippets to illustrate the process. From Counting Dots to Understanding Code: Building the Demeter Analyzer In the first part,we established our mission: build a Roslyn analyzer to sniff out Law of Demeter violations – stopping our code…

  • Demeter and Roslyn–part 1–idea

    Stop Your C# Code Talking to Strangers: Introducing a Law of Demeter Roslyn Analyzer The Law of Demeter (LoD),often summarized as “Only talk to your immediate friends,” is a valuable principle for writing loosely coupled,maintainable code. Code that follows LoD tends to be less fragile and easier to refactor. But manually checking for LoD violations?…

  • RSCG – EntityLengths.Generator

    RSCG – EntityLengths.Generator     name EntityLengths.Generator nuget https://www.nuget.org/packages/EntityLengths.Generator/ link https://github.com/TarasKovalenko/EntityLengths.Generator/ author Taras Kovalenko Generating constants for max length for properties in entities   This is how you can use EntityLengths.Generator . The code that you start with is The code that you will use is   The code that is generated is Code and…

  • What I have learned by building .NET Stars -part 5 – always available data for a display website

    What I have learned by building .NET Stars -part 5 – always available data for a display website Dotnet Stars being a site just for displaying data,it does not require an API per se. Yes,for development purposes it needs a database and an API to display – but later – the data could be retrieved…

  • RSCG-Composite Provider – part 2 -execution

    Imagine this: For every interface IA you create: Your composite provider implements IA seamlessly In the constructor,pass an array of IA providers Each method returns the first successful value from your array of providers For even better performance,use a boolean flag to optimize by reusing previous successes The RSCG_CompositeProvider package doesnΓÇÖt just solve the obvious…

  • RSCG-Composite Provider – part 1 -idea

    API Outage solved with local data The problem that I try to solve is : How an UI can have data to show,even if the API from where it gathers data does not work ? Imagine having a robust system that adaptively switches between retrieving data from multiple sources – including internal APIs,memory-based storage,or even…