Le 15 leggi della corsa di Noakes

Tim Noakes, autore di “The Lore of Running”, ha formulato 15 leggi della corsa, ispirate in gran parte da Arthur Newton, un famoso maratoneta britannico degli anni ’20, che ha sviluppato principi di allenamento basati sulla sua esperienza personale. Le leggi di Noakes sono una guida completa per corridori, sia dilettanti che esperti, e trattano diversi aspetti del correre.

Qui puoi scaricare il testo originale (in inglese) in PDF: 15 laws of training.pdf
Ecco le 15 leggi della corsa di Noakes:

  1. Train frequently, all year-round
    Allenati frequentemente, tutto l’anno, per mantenere la condizione fisica costante.
  2. Start gradually and train gently
    Inizia gradualmente e allenati con dolcezza per evitare infortuni e adattare il corpo allo stress dell’allenamento.
  3. Train first for distance, only later for speed
    Allena prima la resistenza (distanza), e solo successivamente aggiungi allenamenti per la velocità.
  4. Don’t set your daily training schedule in stone
    Non stabilire un programma di allenamento rigido; sii flessibile per adattarti al tuo stato fisico e mentale.
  5. Alternate hard and easy training
    Alterna allenamenti duri e leggeri per permettere al corpo di recuperare e migliorare.
  6. At first, try to achieve as much as possible on a minimum of training
    Inizialmente, cerca di ottenere il massimo risultato con il minimo di allenamento necessario, per evitare il rischio di sovrallenamento.
  7. Don’t race when in training or run at race pace for distances above 16 km
    Non gareggiare durante l’allenamento, né correre a ritmo di gara per distanze superiori ai 16 km.
  8. Specialize
    Specializzati in un tipo specifico di corsa o distanza per ottimizzare le tue capacità.
  9. Incorporate base training and peaking (sharpening)
    Integra nell’allenamento sia una fase di preparazione di base (resistenza) sia una fase di affinamento (picco di prestazione).
  10. Don’t overtrain
    Non sovrallenarti; il recupero è fondamentale per il miglioramento.
  11. Train with a coach
    Allenati con un allenatore per ottenere guida e supporto tecnico.
  12. Train the mind
    Allena la mente; la corsa è tanto una sfida mentale quanto fisica.
  13. Rest before a big race
    Riposa prima di una gara importante, per permettere al corpo di recuperare e prepararsi al meglio.
  14. Keep a detailed logbook
    Tieni un diario dettagliato degli allenamenti per monitorare i progressi e identificare eventuali aree di miglioramento.
  15. Understand the holism of training
    Comprendi l’olismo dell’allenamento; tutti gli aspetti fisici, mentali e emotivi del corridore contribuiscono al successo.

Recupero Attivo

Il Recupero Attivo è una strategia di recupero che prevede l’esecuzione di attività fisiche leggere o a bassa intensità subito dopo un allenamento intenso o durante i giorni di riposo. L’obiettivo è favorire il recupero muscolare e cardiovascolare, riducendo l’affaticamento, migliorando la circolazione sanguigna e accelerando l’eliminazione delle scorie metaboliche, come l’acido lattico, che si accumulano durante lo sforzo fisico.

Caratteristiche del Recupero Attivo:

  1. Attività a bassa intensità: Le attività svolte durante il recupero attivo devono essere leggere e non faticose. Possono includere camminata, ciclismo leggero, nuoto, yoga o esercizi di stretching dinamico.
  2. Durata e Intensità:
    • L’intensità del recupero attivo è generalmente inferiore al 50% della capacità massima dell’atleta.
    • La durata può variare da 15 a 60 minuti, a seconda dell’attività e del livello di affaticamento accumulato.
  3. Obiettivi:
    • Migliorare la circolazione: Le attività leggere stimolano la circolazione sanguigna, portando ossigeno e nutrienti ai muscoli affaticati e facilitando l’eliminazione delle tossine accumulate.
    • Ridurre la rigidità muscolare: Il movimento leggero aiuta a prevenire l’indolenzimento e la rigidità muscolare, spesso associati agli allenamenti intensi.
    • Favorire il rilassamento: Il recupero attivo riduce lo stress psicologico post-allenamento, contribuendo a un recupero mentale oltre che fisico.

Esempi di Recupero Attivo:

  • Camminata: Una passeggiata rilassante può aiutare a mantenere il flusso sanguigno attivo e a favorire il recupero muscolare senza mettere ulteriore stress sulle articolazioni.
  • Ciclismo leggero: Pedalare a un ritmo blando, senza sforzare le gambe, è un buon modo per recuperare dopo una corsa o un allenamento intenso, mantenendo il cuore attivo senza affaticarsi.
  • Nuoto a bassa intensità: Il nuoto è un’attività a basso impatto che permette di muovere i muscoli in modo fluido, aiutando il recupero senza stress meccanico.
  • Yoga o stretching: Praticare lo yoga leggero o fare stretching dinamico aiuta a mantenere la flessibilità e a rilassare i muscoli tesi.
  • Jogging leggero: Per i runner, un jogging molto lento può essere considerato recupero attivo, poiché mantiene il corpo in movimento a un’intensità molto ridotta rispetto a una corsa normale.

Benefici del Recupero Attivo:

  1. Accelera il recupero muscolare: Favorisce l’eliminazione dell’acido lattico e di altre scorie metaboliche che si accumulano durante l’esercizio fisico intenso, riducendo l’indolenzimento muscolare a insorgenza ritardata (DOMS).
  2. Migliora la circolazione: Le attività leggere stimolano il flusso sanguigno, portando più rapidamente nutrienti e ossigeno ai muscoli danneggiati e facilitando la riparazione tissutale.
  3. Riduce la rigidità e la tensione: Il movimento delicato impedisce che i muscoli si irrigidiscano, migliorando la flessibilità e prevenendo contratture muscolari.
  4. Mantiene l’abitudine al movimento: Aiuta a mantenere la routine di allenamento senza affaticare eccessivamente il corpo, ideale per chi non vuole interrompere completamente l’attività fisica durante i giorni di riposo.

Quando usare il Recupero Attivo:

  • Dopo un allenamento intenso: Invece di un riposo completo immediato, una sessione di recupero attivo può essere fatta dopo una gara, un allenamento ad alta intensità o un allenamento di resistenza prolungato.
  • Durante i giorni di riposo: Nei giorni di riposo tra due allenamenti intensi, il recupero attivo può aiutare a mantenere un certo livello di attività fisica senza sovraccaricare il corpo.
  • Come defaticamento post-allenamento: Dopo una sessione di allenamento, una breve attività leggera può servire come defaticamento per facilitare il ritorno del corpo a uno stato di riposo.

In sintesi, il Recupero Attivo è un metodo efficace per ottimizzare la fase di recupero dopo allenamenti intensi, mantenendo il corpo in movimento a bassa intensità. Aiuta a ridurre l’affaticamento, migliorare la circolazione e prevenire la rigidità muscolare, promuovendo un recupero più rapido e completo.

Reset stored git password

To fix this on macOS, you can use

git config --global credential.helper osxkeychain

A username and password prompt will appear with your next Git action (pull, clone, push, etc.).

For Windows, it’s the same command with a different argument:

git config --global credential.helper wincred

C# Web API client Authentication with X-API-KEY

The Web API can authenticate the client through an API key with a middleware or an action filter.

Here’s how you can implement a middleware that does that:

public class ApiKeyMiddleware
{
    private readonly RequestDelegate _next;
    private const string ApiKeyHeaderName = "X-API-KEY";

    public ApiKeyMiddleware(RequestDelegate next)
    {
        _next = next;
    }

    public async Task InvokeAsync(HttpContext context)
    {
        if (!context.Request.Headers.TryGetValue(ApiKeyHeaderName, out var potentialApiKey))
        {
            context.Response.StatusCode = StatusCodes.Status401Unauthorized;
            await context.Response.WriteAsync("Unauthorized");
            return;
        }

        var configuration = context.RequestServices.GetRequiredService<IConfiguration>();
        var validApiKey = configuration.GetValue<string>("ApiKey");

        if (potentialApiKey != validApiKey)
        {
            context.Response.StatusCode = StatusCodes.Status403Forbidden;
            await context.Response.WriteAsync("Forbidden");
            return;
        }

        await _next(context);
    }
}

This middleware checks each incoming request for an "X-API-KEY" header. If the header is absent or the key is invalid, it rejects the request with an HTTP 401 or 403 status.

You can use this middleware in your Startup.cs like this:

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
    // ...

    app.UseMiddleware<ApiKeyMiddleware>();

    // ...
}

In appsettings.json:

{
    "ApiKey": "your-valid-api-key",
    // ...
}

To Add ApiKey in Swagger:

public void ConfigureServices(IServiceCollection services)
{
    // ... other services

    services.AddSwaggerGen(c =>
    {
        c.SwaggerDoc("v1", new OpenApiInfo { Title = "Your API", Version = "v1" });

        // Define the BearerAuth scheme
        c.AddSecurityDefinition("BearerAuth", new OpenApiSecurityScheme
        {
            Description = "Input your Bearer token in the following format - Bearer {your token here}",
            Name = "Authorization",
            In = ParameterLocation.Header,
            Type = SecuritySchemeType.ApiKey,
            Scheme = "BearerAuth"
        });

        c.AddSecurityRequirement(new OpenApiSecurityRequirement
        {
            {
                new OpenApiSecurityScheme
                {
                    Reference = new OpenApiReference
                    {
                        Type = ReferenceType.SecurityScheme,
                        Id = "BearerAuth"
                    },
                    Scheme = "oauth2",
                    Name = "BearerAuth",
                    In = ParameterLocation.Header
                },
                new List<string>()
            }
        });
    });
}

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
    // ... other middleware

    app.UseSwagger();
    app.UseSwaggerUI(c =>
    {
        c.SwaggerEndpoint("/swagger/v1/swagger.json", "Your API V1");
        c.RoutePrefix = string.Empty;
    });
}

In order to receive other custom headers like X-UserName:

public class UserNameMiddleware
{
    private readonly RequestDelegate _next;
    private const string UserNameHeaderName = "X-AUTH-USERNAME";

    public UserNameMiddleware(RequestDelegate next)
    {
        _next = next;
    }

    public async Task InvokeAsync(HttpContext context)
    {
        if (context.Request.Headers.TryGetValue(UserNameHeaderName, out var userName))
        {
            context.Items[UserNameHeaderName] = userName.ToString();
        }

        await _next(context);
    }
}

And then, in startup.cs

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
    // ...

    app.UseMiddleware<UserNameMiddleware>();

    // ...
}

Access SQL queries Generated By Entity Framework Core 3

Create a class EntityFrameworkSqlLogger.cs

using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using Microsoft.Extensions.Logging;

namespace MyApp.Logging
{
    /// <summary>
    /// ILogger implementation
    /// </summary>
    public class EntityFrameworkSqlLogger : ILogger
    {
        #region Fields
        Action<EntityFrameworkSqlLogMessage> _logMessage;
        #endregion

        #region Constructor
        public EntityFrameworkSqlLogger(Action<EntityFrameworkSqlLogMessage> logMessage)
        {
            _logMessage = logMessage;
        }
        #endregion

        #region Implementation
        public IDisposable BeginScope<TState>(TState state)
        {
            return default;
        }

        public bool IsEnabled(LogLevel logLevel)
        {
            return true;
        }

        public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
        {
            if (eventId.Id != 20101)
            {
                //Filter messages that aren't relevant.
                //There may be other types of messages that are relevant for other database platforms...

                return;
            }

            if (state is IReadOnlyList<KeyValuePair<string, object>> keyValuePairList)
            {
                var entityFrameworkSqlLogMessage = new EntityFrameworkSqlLogMessage
                (
                    eventId,
                    (string)keyValuePairList.FirstOrDefault(k => k.Key == "commandText").Value,
                    (string)keyValuePairList.FirstOrDefault(k => k.Key == "parameters").Value,
                    (CommandType)keyValuePairList.FirstOrDefault(k => k.Key == "commandType").Value,
                    (int)keyValuePairList.FirstOrDefault(k => k.Key == "commandTimeout").Value,
                    (string)keyValuePairList.FirstOrDefault(k => k.Key == "elapsed").Value
                );

                _logMessage(entityFrameworkSqlLogMessage);
            }
        }
        #endregion
    }
    
    /// <summary>
    /// Data model
    /// </summary>
    public class EntityFrameworkSqlLogMessage
    {
        public EntityFrameworkSqlLogMessage(
            EventId eventId,
            string commandText,
            string parameters,
            CommandType commandType,
            int commandTimeout,
            string elapsed
        )
        {
            EventId = eventId;
            CommandText = commandText;
            Parameters = parameters;
            CommandType = commandType;
            Elapsed = elapsed;
            CommandTimeout = commandTimeout;
        }

        public string Elapsed { get; }
        public int CommandTimeout { get; }
        public EventId EventId { get; }
        public string CommandText { get; }
        public string Parameters { get; }
        public CommandType CommandType { get; }
    }
    
    /// <summary>
    /// ILogger provider
    /// </summary>
    public class SingletonLoggerProvider : ILoggerProvider
    {
        #region Fields
        ILogger _logger;
        #endregion

        #region Constructor
        public SingletonLoggerProvider(ILogger logger)
        {
            _logger = logger;
        }
        #endregion

        #region Implementation
        public ILogger CreateLogger(string categoryName)
        {
            return _logger;
        }

        public void Dispose()
        {
        }
        #endregion
    }
}

Add Logger to DbContext OnConfiguring Met

public class CartServiceDbContext : DbContext
{
...

  protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
  {
      var entityFrameworkSqlLogger = new EntityFrameworkSqlLogger((m) =>
      {
          System.Console.WriteLine($"SQL Query:\r\n{m.CommandText}\r\nElapsed:{m.Elapsed} millisecods\r\n\r\n");
      });

      var myLoggerFactory = LoggerFactory.Create(builder =>
      {
          builder
              .AddFilter((category, level) =>
                  category == DbLoggerCategory.Database.Command.Name
                  && level == LogLevel.Information);
      });

      myLoggerFactory.AddProvider(new SingletonLoggerProvider(entityFrameworkSqlLogger));
      optionsBuilder.UseLoggerFactory(myLoggerFactory);
      DbConnectorUtils.ConfigureOptionsBuilder(optionsBuilder);
  }

...
}

References

ssh Github

Mac from Terminal

ssh-keygen -t ed25519 -C "yourmail@domain.com"

output:

Generating public/private ed25519 key pair.
Enter file in which to save the key (/Users/<xxxxx>/.ssh/<yyyy>): /Users/<xxxxx>/.ssh/github_id 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /Users/<xxxxx>/.ssh/github_id
Your public key has been saved in /Users/<xxxxx>/.ssh/github_id.pub
The key fingerprint is:
.....
The key's randomart image is:
+--[ED25519 256]--+
|    ..   .=..    |
|     .o  ..S..   |
|     ..  ..o. . .|
|  . o. ..o . . o |
|   =+...S = . +  |
|  oS.++  o + .   |
|    o+.+    . o  |
|      o..    . . |
|       o..E      |
+----[SHA256]-----+

go to https://github.com/settings/keys

click to New SSH Key

write a title, select Authentication Key, copy content of <yyyy>.pub file to the Key area

Serilog

            var configuration = new ConfigurationBuilder()
                .SetBasePath(Directory.GetCurrentDirectory())
                .AddJsonFile("appsettings.json")
                //.AddJsonFile($"appsettings.{Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Production"}.json", true)
                .Build();

        Log.Logger = new LoggerConfiguration()
            .ReadFrom.Configuration(configuration)
            .Enrich.WithEnvironmentName()
            .Enrich.WithProperty("ApplicationNameaaaa", "my application")
            .CreateLogger();
            var configuration = new ConfigurationBuilder()
                .SetBasePath(Directory.GetCurrentDirectory())
                .AddJsonFile("appsettings.json")
                //.AddJsonFile($"appsettings.{Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Production"}.json", true)
                .Build();

        Log.Logger = new LoggerConfiguration()
            .MinimumLevel.Override("Microsoft", LogEventLevel.Information)
            .MinimumLevel.Override("Microsoft.AspNetCore", LogEventLevel.Warning)
            .Enrich.FromLogContext()
            .WriteTo.Console(new RenderedCompactJsonFormatter())
            .WriteTo.Debug(new RenderedCompactJsonFormatter())
            .WriteTo.File(
                new RenderedCompactJsonFormatter(),
                @"./logs/log-.txt",
                fileSizeLimitBytes: 1_000_000,
                rollOnFileSizeLimit: true,
                shared: true,
                flushToDiskInterval: TimeSpan.FromSeconds(1))
            .CreateLogger();

in appsettings.json:

  "Serilog": {
    "MinimumLevel": {
      "Default": "Information",
      "Override": {
        "Microsoft": "Warning",
        "System": "Warning",
        "System.Net.Http.HttpClient": "Warning"
      }
    },
    "WriteTo": [
      {
        "Name": "Debug",
        "Args": {
          "theme": "Serilog.Sinks.SystemConsole.Themes.AnsiConsoleTheme::Code, Serilog.Sinks.Console",
          "formatter": "Serilog.Formatting.Compact.RenderedCompactJsonFormatter, Serilog.Formatting.Compact"
        }
      },
      {
        "Name": "Console",
        "Args": {
          "theme": "Serilog.Sinks.SystemConsole.Themes.AnsiConsoleTheme::Code, Serilog.Sinks.Console",
          "formatter": "Serilog.Formatting.Compact.RenderedCompactJsonFormatter, Serilog.Formatting.Compact"
        }
      },
      {
        "Name": "Logger",
        "Args": {
          "configureLogger": {
            "Filter": [
              {
                "Name": "ByIncludingOnly",
                "Args": {
                  "expression": "Contains(SourceContext, 'nomeapp') and (@Level = 'Error' or @Level = 'Fatal' or @Level = 'Warning')"
                }
              }
            ],
            "WriteTo": [
              {
                "Name": "File",
                "Args": {
                  "path": "Logs/Error/applog_.json",
                  "formatter": "Serilog.Formatting.Json.JsonFormatter, Serilog",
                  "rollingInterval": "Day",
                  "retainedFileCountLimit": 7
                }
              },
              {
                "Name": "MongoDBBson",
                "Args": {
                  "databaseUrl": "mongodb://user:password@server1,server2,server3/database?authSource=admin&replicaSet=database",
                  "collectionName": "logs",
                  "cappedMaxSizeMb": "1024",
                  "cappedMaxDocuments": "50000"
                }
              }
            ]
          }
        }
      },
      {
        "Name": "Logger",
        "Args": {
          "configureLogger": {
            "Filter": [
              {
                "Name": "ByIncludingOnly",
                "Args": {
                  "expression": "Contains(SourceContext, 'nomeapp') and @Level = 'Information'"
                }
              }
            ],
            "WriteTo": [
              {
                "Name": "File",
                "Args": {
                  "path": "Logs/Info/applog_.json",
                  "formatter": "Serilog.Formatting.Json.JsonFormatter, Serilog",
                  "rollingInterval": "Day",
                  "retainedFileCountLimit": 7
                }
              },
              {
                "Name": "MongoDBBson",
                "Args": {
                  "databaseUrl": "mongodb://user:password@server1,server2,server3/database?authSource=admin&replicaSet=replicaname",
                  "collectionName": "logs",
                  "cappedMaxSizeMb": "1024",
                  "cappedMaxDocuments": "50000"
                }
              }
            ]
          }
        }
      }
    ],
    "Enrich": [ "FromLogContext", "WithMachineName", "WithThreadId", "WithThreadName" ],
    "Properties": {
      "app": "nome",
      "app_environment": "dev", /*dev,tst,itg,pef,prd*/
      "log.level": "", /*error,info,debug,warning*/
      "tenant": "nometeam" 
    }
  }

Useful GitHub Repos for developers

Useful Resources for Front-End Developers

Front-End-Web-Development-Resources

Lots and lots of freely available programming books, screencasts, podcasts, and even online video tutorials of all sorts. If you are looking for learning materials

https://github.com/RitikPatni/Front-End-Web-Development-Resources

WTFJS

As the name suggests, this repo has a list of WTF examples of JavaScript that should be known by every web developer.

By knowing what they are, you can understand why they occur in the first place and thereby understand JavaScript better.

https://github.com/denysdovhan/wtfjs

Awesome

The most popular repo that curates all topics from software development to hardware to business.

https://github.com/sindresorhus/awesome

List of (Advanced) JavaScript Questions

This repository by Lydia Hallie provides you with a list of JavaScript questions updated regularly by Lydia herself. This repo will definitely help you prepare for your technical JS interview. Also, this repo supports 16 languages.

https://github.com/lydiahallie/javascript-questions

JavaScript Algorithms and Data Structures

We have the trend in the tech world to talk a lot about algorithms and that we have to know them! So, here is this fantastic repo where you can find most of them.

The really cool thing is that every algorithm is written in JavaScript and has been tested. So it is even easier for you to understand!

https://github.com/trekhleb/javascript-algorithms

Clean Code JavaScript

We all know that bad code can work because we all have written bad code. It is normal to write bad code. Having a guide to show you what is bad code can help you to write good code.

https://github.com/ryanmcdermott/clean-code-javascript

Free-for.dev

Developers and open-source authors now have a massive amount of services offering free tiers, but it can be hard to find them all in order to make informed decisions.

This is list of software (SaaS, PaaS, IaaS, etc.) and other offerings that have free tiers for developers.

https://github.com/ripienaar/free-for-dev

List of Free Learning Resources

It offers lots and lots of freely available programming books, screencasts, podcasts, and even online courses of all sorts. If you are looking for learning materials — look no further!

https://github.com/EbookFoundation/free-programming-books

Awesome First PR Opportunities

This repository is a must-visit for web devs, especially newbie devs who have no experience in open-source projects. Contributing to open source allows you to mingle with the lovely community, share knowledge, be a better developer and maybe eventually get a good job.

A common hurdle is that things can get a bit overwhelming in the beginning. This repository lists open-source projects that are known for or currently have beginner-friendly issues that you can tackle.

https://github.com/MunGell/awesome-for-beginners

Daily-Interview-Question

As the name suggests, this GitHub repo gives you an interview question every day. Ultimately allowing you to gain some keen insights on the tech questions thrown at you during interviews.

Although this website is in Chinese, Google translate will help you.

https://github.com/Advanced-Frontend/Daily-Interview-Question

Useful Resources for Front-End Developers

Awesome Learning Resource

this is pretty much a one-stop destination for your learning needs as a developer. This repo contains freely available programming books, podcasts, and even online video tutorials for a variety of software engineering topics and programming languages.

If you are looking to learn a new language or concept in programming, this is a must-visit repo.

https://github.com/lauragift21/awesome-learning-resources

free-programming-books

As the name suggests, this repo contains a list of free programming books for almost any language or concept in programming. The list is quite huge and has 143,000 stars and 34,900 forks. It’s available in many languages and is comprised of mainly programming books.

https://github.com/EbookFoundation/free-programming-books

Best-websites-a-programmer-should-visit

When learning programming, you must be in touch with certain websites in order to learn the technologies better and to learn new things. This repo contains a list of nonexhaustive websites that you should pretty much be in touch with. This contains podcasts, news websites, resources on competitive programming, things to do when you are bored, and much, much more.

https://github.com/sdmg15/Best-websites-a-programmer-should-visit

Project Guidelines

It contains a set of best practices for JS projects. These guidelines help you write and maintain projects with ease and reduce the level of issues that occur in the whole process. This includes some best practices on Git, documentation, environment, dependencies, testing, and more.

If you want to share a best practice or think one of these guidelines should be removed, you can make a PR.

https://github.com/elsewhencode/project-guidelines

App Ideas Collection

Have you ever wanted to build something but you had no idea what to do? Just as authors sometimes have writer’s block, it’s also true for developers. This Repo contains a list of app ideas categorized according to three tiers of programming experience.

These applications help you improve your coding skills as well as allow you to try out new technologies.

https://github.com/florinpop17/app-ideas

Web Developer Road Map

It contains a set visual illustration on career pathways you could take as a web developer. The purpose of these roadmaps is to give you an idea about the landscape and to guide you if you’re confused about what to learn next.

A simpler, more beginner-friendly version of the illustration is under development. This chart gets updated yearly to reflect any new changes, so you never have to be worried about being outdated.

https://github.com/kamranahmedse/developer-roadmap

Generic method with reflection

Need to write some description and tags

                var collectionName = await _configurationFacade.GetConsumerCollectionArchive(observer.EsbConsumer);
                Type collectionType = Type.GetType($"TaxMs.Esb.Infrastructure.Models.{collectionName}");
                //_context.TryGetCollection<AccountingTax>().Find(x => x.);

                //_context.GetType()
                //    .GetMethod("TryGetCollection")
                //    .MakeGenericMethod(propertyInfo.PropertyType)
                //    .Invoke(mapper, new object[] { "bloggingabout" });

                MethodInfo method = _context.GetType().GetMethod(nameof(_context.TryGetCollection));
                MethodInfo generic = method.MakeGenericMethod(collectionType);
                var mongoCollection = generic.Invoke(this, null);