Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *


    1. Hi Joseph, yes that’s my intention with making the API Public. I will start working on the Blazor version as soon as time allows me to. I am thinking of using mudBlazor Component Library. Any Suggestions?

    1. Hi, AuthenticatedUserService.cs gives you the currently authentication userId. Else, you could also create a userService that uses context to return a list of users. That is a also available in the UserList View. Since User Identity is an Infrastructure Concern, you would need a separate DB call for it.


  1. I am so excited to implement and use this solution in my future project,
    All the best for your awesome work dear Mukesh

  2. First, thank you for all the work you do! I see the IApplicationLayer and IDomainLayer interfaces but I don’t see where they are implemented. Can you explain the thought process behind how they are intended to be used? My other question is about the CacheKeys. Would you be able to explain what the CacheKeys are for and how I use them? I don’t see them discussed in your previous articles but maybe I missed it. Thank you!

  3. Hi Mukesh, a few more questions related to organization for a very large rewrite of code I’m working on.  We have 10+ applications that use different database schemas in an Oracle DB but all use one core schema that contain common information required by all apps such as customers, employees, projects, vendors, etc.  I’m building out an API layer to access all the data.  Each schema uses a different login so I’d be using different DBContext for each one.  I’m curious how to go about organizing the DBContexts if I have the following database schemas:

    ProdData – Common database schema that all other apps require
    Annotator – DB schema for App 1
    Aqua – DB schema for App 2
    IGL – DB schema for App 3

    I would like the API for ProdData and each application’s API to be their own solution and in separate git repos?  The individual application projects would add the ProdData as a nuget package reference. I’m just not sure how that will work with DBContexts, Repositories, and the Linq queries from the applications that need to join tables across schemas?  Do you think that will work?  How would you go about organizing something this complex for a large API project?  Thank you!

    1. Thank you for your great work!! 🙂
      Can you answer here? How to use join with tables using the repositories? Any workaround.

  4. Fantastic Murkesh!!! I was learning about Uncle Bob’s clean architecture and thought it was very good and of course, clean 🙂 I then was going to build something like this from scratch so thank you so much for creating BOTH an API & WEB version.

  5. Awesome Mukesh! Great Work!!
    In the Permissions for Admin Role there are 16 entries.
    I Select the first (Permissions.Brands.View) and from the second page the 16nth (Permissions.Users.Delete) .
    When I click the save button only the 16nth has the selected value equals to true.
    The first ten items of the PermissionViewModel model are null (PermissionController.cs line no 57)
    Why is this happening?
    Am I doing something wrong?
    Thank you in advance.

  6. Hi Mukesh.
    Excellent Work.
    How can I use existing Database with the ASP.NET Core Hero Boilerplate?


    1. Hi! Thanks.
      I would recommend using a fresh DB. However, since this is EF Core, you can use existing DBs as well. you will need to modify the Migration’s Up and Down Transactions to match your requirement though.

  7. Thanks for all the articles, got you a few cups of coffee, wish I could get my company to buy you some, your articles save me a lot of time. You have a knack for reducing a large amount of information into a concise readable format. I especially like your citing of previous works you are building on, this lends a great deal of credibility to your projects. I have compared all your templates and projects from the .net 5.0 to Dapper and EF and it is amazing how you stayed within best practices, so very, very good job. For those who doubt, check these out, Microsofts eShopOnWeb with included best practices and Code-Maze CQRS pattern
    Now a little detail, in your boilerplate template, the ServicesCollectionExtensions.cs options.UseSqlServer(configuration.GetConnectionString(“ApplicationConnection”) tries to obtain ApplicationConnection but the ConnectionString in AppSettings is named “DefaultConnection” throwing an error
    Good Luck and Thanks Again Jeffrey

    1. Thanks a lot for the coffees mate 🙂 And really thanks for the feedback as well 😀
      I had checked the appseettings json. However I couldn’t notice the issue that you have mentioned. Could you help me out here.


  8. Cache is not getting cleared on logout or on restarting the new session. it still brings up previous information, please suggest how to fix it.

  9. Is it possbile to support:
    1- NSwag Swagger toolchain(something like Abp Framework in angular version abp-generate-proxy)
    2- Redis
    3- signalR

    1. var userRoles = _roleManager.Roles.Where(x => userRoleNames.Contains(x.Name)).ToList();

      should be

      var userRoles = _roleManager.Roles.Where(x => userRoleNames.Contains(x.Name)).ToList();

      otherwise I get the following error

      “A Command Is Already In Progress” : SELECT, a.concurrencystamp,, a.normalizedname FROM identity.”AspNetCore_Roles” AS a WHERE IN (‘Admin’, ‘Moderator’, ‘Basic’, ‘SuperAdmin’)

  10. Hi Mukesh,

    Really a good work and thank you for deep dive into project architecture information.
    After reading all the articles provided by you. I have started implementing in my new project.
    Can we call webapi from mvc project in this given architecture? If yes then please provide some tips or demo code for the same.

      1. Hi Mukesh,

        Just wanted to confirm that if in your mvc project if I remove Identity Area and make my custom logic for register and also if I make changes in existing mvc project which will consume API will that work?
        Or its better to make a separate MVC project and consume APIs of this project?


  11. Hi Mukesh,

    This is very Awesome article and I appreciate your hard work for Clean Architecture Boilerplate.
    I am so happy with this solution but I have few question regarding this solution.

    1) It is support the multi-Tenancy? If Yes(please explain me) If No(Please explain me how can I implement schema-based or multi-Tenancy).
    2) Can you suggest me how can I display the Permissions in Tree view format like (parent and child menu based)
    Similar to below
    or you can suggest any tree view format.

    Thanks in advance.

  12. Hi Mukesh,

    Thank you so much for all your hard work. I’ve learned a lot about clean architecture from this template. I noticed that the MVC does not consume the API. Do you know if there is any way that I can consume the API? I’ve tried using multiple projects to start up the solution and removed the authentication requirement in the API but my AJAX call in the MVC does not seem to work. The API does work in swagger though. Thanks again for your help! I’m learning a lot and appreciate all of your hard work.

  13. Hi Mukesh,
    Thank you very much for your article I have issue while calling Stored Procedure could you please help me to figure out how would I do this?

    Thank you,

  14. A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server)

    Dont know why this is happening. Have checked the connection and is Ok. Still when using update command the error is comming.

  15. I’m using the mvc layer and after I add this to my project when selecting manage user role on a user it gives me this error InvalidOperationException: There is already an open DataReader associated with this Connection which must be closed first.

  16. Hi Mukesh,
    Thanks alot for this article it really helped me a lot.

    I wish I could have a detailed CRUD documentation as its bit hard for me to just to have a look at code and to figure our to develop my custom form here.

    It would be appreciable if you could provide few pointers how to do it.

  17. I am utilizing as my email sender. I cannot figure out why it will not allow me to send emails.

    My setup for credentials is as follows in the AppSettings.
    “MailSettings”: {
    “From”: “{UserName Entered Here}”,
    “Host”: “”,
    “Port”: 587,
    “UserName”: “{UserName Entered Here”,
    “Password”: “XXXXXXXXtLhjdcZG”,
    “DisplayName”: “SGLEMC – Lubbock”

    It works in my other sites….

  18. Mukesh, I love, love, love this template. It has saved me so much time and headaches with putting together a new project I am starting to work on.
    I am sending you TWO (more) Coffee’s

  19. Hi Mukesh.
    Excellent Work. Thank you so much for this template

    but having issue when i updated this project version to .net 7 bcoz .net 5 was not installed at my end so and updated all packages to latest versions.
    after this i checked not able to save in brand table –
    await _brandRepository.InsertAsync(product);
    await _unitOfWork.Commit(cancellationToken);
    i noticed from insertAsync Brand.Id is not returning and when execute commit line its throwing exception
    One or more errors occurred. (Method not found: ‘System.String Microsoft.EntityFrameworkCore.Metadata.IPropertyBase.get_Name()’.)
    please help on this
    thanks you

  20. I’m using AdvancedFilter, I see you’ve implemented some code but you haven’t used it so if you could guide me a bit?