Category: .NET

  • RSCG – immediate.apis

    RSCG – immediate.apis     name immediate.apis nuget https://www.nuget.org/packages/immediate.apis/ link https://github.com/immediateplatform/immediate.apis author Stuart Turner Defining APIs in classes instead of in minimal API or controllers   This is how you can use immediate.apis . The code that you start with is The code that you will use is   The code that is generated is…

  • AI and clean a .NET solution of warnings

    This is about how I wanted to clean a C# solution of warnings. The solution had a lot of warnings, and I wanted to remove them. I started with a simple prompt to remove all warnings, but that didn’t work. The number of iterations were : 17 For the ones in a hurry ,this is…

  • Aspire and upgrading WordPress–programming

    Now the problem was how to modify the insert generated by old WordPress backup to the new columns . But I wanted to do it in one shot . So a new application: instead of WSL, I will put into Docker( WordPress has already a docker image). Instead of PowerShell, I will have a .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…