<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Cristiano Coelho</title>
    <description>The latest articles on Forem by Cristiano Coelho (@criscoelho).</description>
    <link>https://forem.com/criscoelho</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3021794%2F9372516f-e1c3-485f-9571-59c27a9e2d1a.png</url>
      <title>Forem: Cristiano Coelho</title>
      <link>https://forem.com/criscoelho</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/criscoelho"/>
    <language>en</language>
    <item>
      <title>MediatR Simple Alternative</title>
      <dc:creator>Cristiano Coelho</dc:creator>
      <pubDate>Wed, 09 Apr 2025 03:09:07 +0000</pubDate>
      <link>https://forem.com/criscoelho/-dl6</link>
      <guid>https://forem.com/criscoelho/-dl6</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/criscoelho/developing-your-easy-alternative-to-the-mediatr-library-in-c-1og2" class="crayons-story__hidden-navigation-link"&gt;Developing your easy alternative to the MediatR library in C#&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/criscoelho" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3021794%2F9372516f-e1c3-485f-9571-59c27a9e2d1a.png" alt="criscoelho profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/criscoelho" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Cristiano Coelho
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Cristiano Coelho
                
              
              &lt;div id="story-author-preview-content-2390086" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/criscoelho" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3021794%2F9372516f-e1c3-485f-9571-59c27a9e2d1a.png" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Cristiano Coelho&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/criscoelho/developing-your-easy-alternative-to-the-mediatr-library-in-c-1og2" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Apr 8 '25&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/criscoelho/developing-your-easy-alternative-to-the-mediatr-library-in-c-1og2" id="article-link-2390086"&gt;
          Developing your easy alternative to the MediatR library in C#
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/dotnet"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;dotnet&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/csharp"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;csharp&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/programming"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;programming&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/criscoelho/developing-your-easy-alternative-to-the-mediatr-library-in-c-1og2" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;5&lt;span class="hidden s:inline"&gt; reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/criscoelho/developing-your-easy-alternative-to-the-mediatr-library-in-c-1og2#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              1&lt;span class="hidden s:inline"&gt; comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            3 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>dotnet</category>
      <category>csharp</category>
      <category>programming</category>
    </item>
    <item>
      <title>Developing your easy alternative to the MediatR library in C#</title>
      <dc:creator>Cristiano Coelho</dc:creator>
      <pubDate>Tue, 08 Apr 2025 04:07:14 +0000</pubDate>
      <link>https://forem.com/criscoelho/developing-your-easy-alternative-to-the-mediatr-library-in-c-1og2</link>
      <guid>https://forem.com/criscoelho/developing-your-easy-alternative-to-the-mediatr-library-in-c-1og2</guid>
      <description>&lt;p&gt;In recent weeks, there has been a rumor that the famous MediatR library, widely used by the C#/.NET developer community, especially for projects that implement the CQRS pattern, will enter the commercial license.&lt;/p&gt;

&lt;p&gt;What I want to make clear, initially, is that one does not need the other to exist. However, when talking about a solution that implements CQRS, developers immediately think of the Mediator pattern and, of course, the library by Jimmy Bogard, who is also behind another famous library in the .NET world, AutoMapper, which, by the way, will also be commercialized.&lt;/p&gt;

&lt;p&gt;Of course, you say at first? Oh, what do you mean? Until now it was open source and he had said that he would never make it commercial. (He wrote this when asked once).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fja7ev5pwmp7o8z0jdu7s.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fja7ev5pwmp7o8z0jdu7s.jpg" alt="OH My God" width="300" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But that's okay, he has the right to change his mind, especially when circumstances change. He himself explained on his blog that the main reason for charging for use is to maintain the project and the necessary updates, which was previously paid for by the company he worked for.&lt;/p&gt;

&lt;p&gt;That said, I wanted to present an easy way to make your own solution to replace MediatR. Of course, here is a much simpler solution, with fewer features, but it serves the basics of handling query and command calls.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's get to the solution:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkrekoukgo1l0l3pb7wnl.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkrekoukgo1l0l3pb7wnl.jpg" alt="We Have The Solution" width="600" height="338"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First you will have to create 4 interfaces, 2 for commands and 2 for queries. One of them will be the contract for the handler and the other for the dispatcher.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3fjxm5s1ewhxx2ec0h0x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3fjxm5s1ewhxx2ec0h0x.png" alt="Interfaces" width="326" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;IQueryHandler:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd66gcaaqm14fz7p4qfob.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd66gcaaqm14fz7p4qfob.png" alt="IQueryHandler" width="800" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;IQueryDispatcher:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8ytznkei5jxagxe051mi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8ytznkei5jxagxe051mi.png" alt="IQueryDispatcher" width="800" height="313"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;ICommandHandler:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsp1ea81kib0gr5n7fltf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsp1ea81kib0gr5n7fltf.png" alt="ICommandHandler" width="800" height="289"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;ICommandDispatcher&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7spp7e9jaq4l9nqn0ayh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7spp7e9jaq4l9nqn0ayh.png" alt="ICommandDispatcher" width="800" height="291"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For the magic to happen, we now have to implement the Dispatcher Interfaces to inject the IServiceProvider that will be responsible for retrieving the instances of IQueryHandler and ICommandHandler interfaces. These instances in turn represent the Handlers for the specific queries or commands and their result types.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F05jhu5tc3t315ewz39wd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F05jhu5tc3t315ewz39wd.png" alt="Dispatchers" width="365" height="239"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;QueryDispatcher:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1t4z8k1vxxkr4xjcur1d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1t4z8k1vxxkr4xjcur1d.png" alt="QueryDispatcher" width="800" height="499"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;CommandDispatcher:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frht5elaelplivl7qj2h4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frht5elaelplivl7qj2h4.png" alt="CommandDispatcher" width="800" height="516"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  How Can I use that?
&lt;/h3&gt;

&lt;p&gt;Well, now you can use this implementation and have the separation between queries and commands and the decoupling so desired with the mediator pattern. As an example, I implemented a User query by ID. To do this, you must create 2 classes, one that represents the query and the other the handler. Also create the dto object that will be the return in your API controller.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F65vv810rd6r5txfyjw9f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F65vv810rd6r5txfyjw9f.png" alt="Dto And Query Handler" width="357" height="451"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;UserResponseDto:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Febhjbx9c42tzhyrizuw3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Febhjbx9c42tzhyrizuw3.png" alt="UserResponseDto" width="800" height="222"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GetUserByIdQuery:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4nm0nsamp4lr968cnocb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4nm0nsamp4lr968cnocb.png" alt="GetUserByIdQuery" width="800" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GetUserByIdQueryHandler:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F00o6bu7oq7ft3z1hknde.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F00o6bu7oq7ft3z1hknde.png" alt="GetUserByIdQueryHandler" width="800" height="506"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, you are ready to call this in your controller. In the controller, you need to inject the Dispatcher services and then use them in all the endpoints that are necessary.&lt;/p&gt;

&lt;p&gt;To demonstrate the use, I created a controller called UsersController with a GetById method.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe2769jewjoa4ec2smexa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe2769jewjoa4ec2smexa.png" alt="Controller" width="263" height="195"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;UsersController:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpwvmm44hux06loo5a0hb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpwvmm44hux06loo5a0hb.png" alt="UsersController" width="800" height="957"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Don't forget to add the declarations to inject the services into the dependency container in Program.cs.&lt;/p&gt;

&lt;p&gt;Program.cs:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1gp2t7lt3rgoiza6lx36.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1gp2t7lt3rgoiza6lx36.png" alt="Program.cs" width="800" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion:
&lt;/h2&gt;

&lt;p&gt;This is the end of this article. I showed you a very simplified way to have the main functionality of Jimmy Bogard's famous library. A way for you to implement CQRS without depending on an external library. You can create all your queries and commands as you wish, adding them to the necessary use cases. Add anything else you need, such as repository services, logs, etc.&lt;/p&gt;

&lt;p&gt;Good work, see you in the next article!&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>csharp</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
