Category: .NET

  • RSCG – Comparison

    RSCG – Comparison     name Comparison nuget https://www.nuget.org/packages/ReflectionIT.ComparisonOperatorsGenerator/ link https://github.com/sonnemaf/ReflectionIT.ComparisonOperatorsGenerator author Fons Sonnemans If you want to generate comparison operators for your classes, startin with IComparable   This is how you can use Comparison . The code that you start with is The code that you will use is   The code that is…

  • RSCG – NativeObjects

    RSCG – NativeObjects     name NativeObjects nuget https://www.nuget.org/packages/NativeObjects/ link https://github.com/kevingosse/NativeObjects author Kevin Gosse Object to IntPtr and back   This is how you can use NativeObjects . The code that you start with is The code that you will use is   The code that is generated is Code and pdf at https://ignatandrei.github.io/RSCG_Examples/v2/docs/NativeObjects

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