Category: AOPMethods

  • TILT-Server Timing in Browser-part 19

    For see fast what is happening with your server,you can use the Server Timing API. One of the implementations for .NET is https://github.com/tpeczek/Lib.AspNetCore.ServerTiming . Not a big deal – implemented separately with AOPMethodsCommon – but I think it is a good idea to use it. The implementation was straightforward builder.Services.AddScoped<ServerTiming>(); var app = builder.Build(); app.UseServerTiming();…

  • TILT–Telemetry–part 11

    I want to see what is happening in my application – i.e. having the Stack Trace for any kind of errors. I have add with [AutoMethods(CustomTemplateFileName = “../AutoMethod.txt”,MethodPrefix = “auto”,template = TemplateMethod.CustomTemplateFile)] [AutoGenerateInterface] public partial class AuthUrl : IAuthUrl { [AOPMarkerMethod] private async Task<string?> privateLogin(string url,string secret) { //code And inside the method var act=Activity.Current;…

  • Passing from .NET 5 to .NET 6

    First,read the document here: Migrate from ASP.NET Core 5.0 to 6.0 | Microsoft Docs .\ So those were my steps ( fully compile after each step ): 1. Replace in csproj net5.0 with net6.0 <TargetFramework>net6.0</TargetFramework> 2.  Update all nugets reference to the latest version 3.  Add globals.cs with various usings 4. Add globals.cs . Mine…

  • Benchmarking RSCG vs Reflection

    I make a microservices Buffet . In this I consider having email as a service . When the DevOps wants email,he can choose between various plugins ( simple smtp email,gmail,exchange,others). Those plugins can have various properties – that must be edited by the primary administrator of the microservice. The properties can be discovered at runtime…

  • AOPMethods–dogfooding

    I was trying to apply AOPMethods to – surprise! –  AOPMethods project itself. And I have discovered a new reason: I do not want to make the methods public. I just want to put try/catch around them to know what is wrong. The fast – and not so good – idea was to transform MethodPrefix…

  • AOPMethods–adding partial functions and enums

    I was finishing the AOPMethods  – and what I have been thinking is – why not add partial functions ? I have added Console.Write,but … this seems more general… So,now,this is the Person class definition with the partial function definition [AutoMethods(template = TemplateMethod.MethodWithPartial,MethodPrefix =”pub”,MethodSuffix =”bup”)] partial class Person {     partial void Method_Start(string methodName)     {         Console.WriteLine($”start…

  • AOP Methods–Problems in running and solving

    The problems that I have encountered were: 1.  The ThisAssembly  RoslynGenerator that I use should not be put as reference in the nuget. I have fixed this by adding <PackageReference Include=”ThisAssembly.AssemblyInfo” Version=”1.0.0″ ReferenceOutputAssembly=”false” /> 2. I have problems generating code to async code with Task . The problem was that I have added logging (…

  • AOP Methods–Code

    The code is not so much different from SkinnyControllers : Implement ISourceGenerator,putting the Generator attribute on the class [Generator]    public partial class AutoActionsGenerator : ISourceGenerator inspecting the classes if they have the common attribute,generating code with Scriban The problem was : How can the AOPMethods can differentiate between the private function that must be made…

  • AOP Methods–Introduction

    As I have done with Roslyn for SkinnyControllers,I said – what about generating public methods at compile time ? For example,what if this method private string pubFullName() { return FirstName + ” ” + LastName; }   is transformed into this public string FullName( [CallerMemberName] string memberName = “”, [CallerFilePath] string sourceFilePath = “”, [CallerLineNumber]…