Category: projects
-
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
-
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?…
-
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…
-
What I have learned by building .NET Stars -part 4- Keyed Dependency Injection – constructor by keys
As I said before,I have constructed first the interfaces. Then I have a null object pattern for each interface,constructed automatically with a Roslyn Code Generator,https://www.nuget.org/packages/rscg_Interface_to_null_object . And now,what I want is to have keyed DI for each new implementation -with a twist: It’s like a game of matching keys when another class is injected,the first…
-
What I have learned by building .NET Stars -part 3- Aspire
I have that same idea to build a project : is what is called today a Modular Monolith – and it is very old in .NET world as can be implemented as a .sln solution. For those unfamiliar,a Modular Monolith allows you to break down your application into independent modules (think database access,data flow logic,a…
-
What I have learned by building .NET Stars -part 2- interfaces
In my latest project,building a robust system using interfaces has been both a fascinating challenge and an enlightening experience. As I embarked on this journey,it quickly became evident how immensely powerful and transformative thinking in terms of interfaces can be. From the outset,interfacing brought clarity to several core aspects of the application: Data Management: Interfaces…