Giter VIP home page Giter VIP logo

aspnetcorehero / boilerplate Goto Github PK

View Code? Open in Web Editor NEW
576.0 576.0 152.0 8.35 MB

Clean Architecture Solution Template for ASP.NET Core 5.0. Built with Onion/Hexagonal Architecture and incorporates the most essential Packages your projects will ever need. Includes both WebApi and Web(MVC) Projects.

Home Page: https://codewithmukesh.com/project/aspnet-core-hero-boilerplate/

License: MIT License

C# 9.73% HTML 3.93% CSS 36.32% JavaScript 34.77% Less 7.28% SCSS 7.97%
aspnetcore boilerplate clean-architecture clean-code dotnet net5

boilerplate's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

boilerplate's Issues

Razor Page Project

Is your feature request related to a problem? Please describe.
You have a webApi and an MVC project, how about a Razor Page project?

use Uow And Repository

Hi.
It has been argued in several discussions that the use of Uow and Repositories is not very correct, and these are implemented in DbContext itself.
Is using Uow and Repository an Anti-pattern?
You used the Meditor package with Uow. I wanted to know what is the advantage of this?

Switching EF Core to use MySQL or PostgreSQL results in exceptions

Hi Mukesh,

first of all, thanks for a nice boilerplate! :)

I tried switching EF Core to use MySQL and PostgreSQL and in both cases, I managed to get it to work fairly quickly, but as soon as you click on Brands or Products, an exception pops up.

Edit: Actually, anything except Role management and Profile throws an exception.

In the case of MySQL:

System.AggregateException: One or more errors occurred. (This MySqlConnection is already in use. See https://fl.vu/mysql-conn-reuse)
 ---> System.InvalidOperationException: This MySqlConnection is already in use. See https://fl.vu/mysql-conn-reuse
   at MySqlConnector.Core.ServerSession.StartQuerying(ICancellableCommand command) in /_/src/MySqlConnector/Core/ServerSession.cs:line 253
   at MySqlConnector.Core.CommandExecutor.ExecuteReaderAsync(IReadOnlyList`1 commands, ICommandPayloadCreator payloadCreator, CommandBehavior behavior, IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/Core/CommandExecutor.cs:line 54
   at MySqlConnector.MySqlCommand.ExecuteReaderAsync(CommandBehavior behavior, IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/MySqlCommand.cs:line 311
   at MySqlConnector.MySqlCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/MySqlCommand.cs:line 304
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(DbContext _, Boolean result, CancellationToken cancellationToken)
   at Pomelo.EntityFrameworkCore.MySql.Storage.Internal.MySqlExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()
   at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Identity.EntityFrameworkCore.RoleStore`5.GetClaimsAsync(TRole role, CancellationToken cancellationToken)
   at YourWay.Web.Permission.PermissionAuthorizationHandler.HandleRequirementAsync(AuthorizationHandlerContext context, PermissionRequirement requirement) in C:\Users\scrnjakovic\source\repos\YourWay\YourWay\YourWay.Web\Permission\PermissionAuthorizationHandler.cs:line 32
   at Microsoft.AspNetCore.Authorization.AuthorizationHandler`1.HandleAsync(AuthorizationHandlerContext context)
   at Microsoft.AspNetCore.Authorization.DefaultAuthorizationService.AuthorizeAsync(ClaimsPrincipal user, Object resource, IEnumerable`1 requirements)
   at Microsoft.AspNetCore.Authorization.DefaultAuthorizationService.AuthorizeAsync(ClaimsPrincipal user, Object resource, String policyName)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at AspNetCore.Areas_Catalog_Views_Product_Index.ExecuteAsync() in C:\Users\scrnjakovic\source\repos\YourWay\YourWay\YourWay.Web\Areas\Catalog\Views\Product\Index.cshtml:line 9
   at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context)
   at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, Boolean invokeViewStarts)
   at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context)
   at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode)
   at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode)
   at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ActionContext actionContext, IView view, ViewDataDictionary viewData, ITempDataDictionary tempData, String contentType, Nullable`1 statusCode)
   at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewResultExecutor.ExecuteAsync(ActionContext context, ViewResult result)
   at Microsoft.AspNetCore.Mvc.ViewResult.ExecuteResultAsync(ActionContext context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|29_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
   at AspNetCoreHero.ToastNotification.Middlewares.NotyfMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
System.InvalidOperationException: This MySqlConnection is already in use. See https://fl.vu/mysql-conn-reuse
   at MySqlConnector.Core.ServerSession.StartQuerying(ICancellableCommand command) in /_/src/MySqlConnector/Core/ServerSession.cs:line 253
   at MySqlConnector.Core.CommandExecutor.ExecuteReaderAsync(IReadOnlyList`1 commands, ICommandPayloadCreator payloadCreator, CommandBehavior behavior, IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/Core/CommandExecutor.cs:line 54
   at MySqlConnector.MySqlCommand.ExecuteReaderAsync(CommandBehavior behavior, IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/MySqlCommand.cs:line 311
   at MySqlConnector.MySqlCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/MySqlCommand.cs:line 304
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(DbContext _, Boolean result, CancellationToken cancellationToken)
   at Pomelo.EntityFrameworkCore.MySql.Storage.Internal.MySqlExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()
   at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Identity.EntityFrameworkCore.RoleStore`5.GetClaimsAsync(TRole role, CancellationToken cancellationToken)
   at YourWay.Web.Permission.PermissionAuthorizationHandler.HandleRequirementAsync(AuthorizationHandlerContext context, PermissionRequirement requirement) in C:\Users\scrnjakovic\source\repos\YourWay\YourWay\YourWay.Web\Permission\PermissionAuthorizationHandler.cs:line 32
   at Microsoft.AspNetCore.Authorization.AuthorizationHandler`1.HandleAsync(AuthorizationHandlerContext context)
   at Microsoft.AspNetCore.Authorization.DefaultAuthorizationService.AuthorizeAsync(ClaimsPrincipal user, Object resource, IEnumerable`1 requirements)
   at Microsoft.AspNetCore.Authorization.DefaultAuthorizationService.AuthorizeAsync(ClaimsPrincipal user, Object resource, String policyName)

image

image

In case of PostgreSQL:

System.AggregateException: One or more errors occurred. (A command is already in progress: SELECT r."Id", r."ConcurrencyStamp", r."Name", r."NormalizedName"
FROM "Identity"."Roles" AS r
WHERE r."Name" IN ('Admin', 'Moderator', 'Basic', 'SuperAdmin'))
 ---> Npgsql.NpgsqlOperationInProgressException (0x80004005): A command is already in progress: SELECT r."Id", r."ConcurrencyStamp", r."Name", r."NormalizedName"
FROM "Identity"."Roles" AS r
WHERE r."Name" IN ('Admin', 'Moderator', 'Basic', 'SuperAdmin')
   at Npgsql.NpgsqlConnector.<StartUserAction>g__DoStartUserAction|233_0(<>c__DisplayClass233_0& )
   at Npgsql.NpgsqlConnector.StartUserAction(ConnectorState newState, NpgsqlCommand command, CancellationToken cancellationToken, Boolean attemptPgCancellation)
   at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken)
   at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken)
   at Npgsql.NpgsqlCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(DbContext _, Boolean result, CancellationToken cancellationToken)
   at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()
   at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Identity.EntityFrameworkCore.RoleStore`5.GetClaimsAsync(TRole role, CancellationToken cancellationToken)
   at YourWay.Web.Permission.PermissionAuthorizationHandler.HandleRequirementAsync(AuthorizationHandlerContext context, PermissionRequirement requirement) in C:\Users\scrnjakovic\source\repos\YourWay\YourWay\YourWay.Web\Permission\PermissionAuthorizationHandler.cs:line 32
   at Microsoft.AspNetCore.Authorization.AuthorizationHandler`1.HandleAsync(AuthorizationHandlerContext context)
   at Microsoft.AspNetCore.Authorization.DefaultAuthorizationService.AuthorizeAsync(ClaimsPrincipal user, Object resource, IEnumerable`1 requirements)
   at Microsoft.AspNetCore.Authorization.DefaultAuthorizationService.AuthorizeAsync(ClaimsPrincipal user, Object resource, String policyName)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at AspNetCore.Areas_Catalog_Views_Product_Index.ExecuteAsync() in C:\Users\scrnjakovic\source\repos\YourWay\YourWay\YourWay.Web\Areas\Catalog\Views\Product\Index.cshtml:line 9
   at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context)
   at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, Boolean invokeViewStarts)
   at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context)
   at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode)
   at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode)
   at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ActionContext actionContext, IView view, ViewDataDictionary viewData, ITempDataDictionary tempData, String contentType, Nullable`1 statusCode)
   at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewResultExecutor.ExecuteAsync(ActionContext context, ViewResult result)
   at Microsoft.AspNetCore.Mvc.ViewResult.ExecuteResultAsync(ActionContext context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|29_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
   at AspNetCoreHero.ToastNotification.Middlewares.NotyfMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
Npgsql.NpgsqlOperationInProgressException (0x80004005): A command is already in progress: SELECT r."Id", r."ConcurrencyStamp", r."Name", r."NormalizedName"
FROM "Identity"."Roles" AS r
WHERE r."Name" IN ('Admin', 'Moderator', 'Basic', 'SuperAdmin')
   at Npgsql.NpgsqlConnector.<StartUserAction>g__DoStartUserAction|233_0(<>c__DisplayClass233_0& )
   at Npgsql.NpgsqlConnector.StartUserAction(ConnectorState newState, NpgsqlCommand command, CancellationToken cancellationToken, Boolean attemptPgCancellation)
   at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken)
   at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken)
   at Npgsql.NpgsqlCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(DbContext _, Boolean result, CancellationToken cancellationToken)
   at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()
   at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Identity.EntityFrameworkCore.RoleStore`5.GetClaimsAsync(TRole role, CancellationToken cancellationToken)
   at YourWay.Web.Permission.PermissionAuthorizationHandler.HandleRequirementAsync(AuthorizationHandlerContext context, PermissionRequirement requirement) in C:\Users\scrnjakovic\source\repos\YourWay\YourWay\YourWay.Web\Permission\PermissionAuthorizationHandler.cs:line 32
   at Microsoft.AspNetCore.Authorization.AuthorizationHandler`1.HandleAsync(AuthorizationHandlerContext context)
   at Microsoft.AspNetCore.Authorization.DefaultAuthorizationService.AuthorizeAsync(ClaimsPrincipal user, Object resource, IEnumerable`1 requirements)
   at Microsoft.AspNetCore.Authorization.DefaultAuthorizationService.AuthorizeAsync(ClaimsPrincipal user, Object resource, String policyName)

image

image

All Nuget packages referencing 5.0.1 were updated to 5.0.2, in case it helps resolving this.

Possible to use generic handler?

To prevent too much works to do from creating too many handlers classes, is it possible to use generic handler for all entities? Or not recommended to use generic handler?

From

public partial class CreateBrandCommand : IRequest<Result<int>>
    {
        public string Name { get; set; }
        public string Description { get; set; }
        public decimal Tax { get; set; }
    }
public class CreateBrandCommandHandler : IRequestHandler<CreateBrandCommand, Result<int>>
    {
        private readonly IBrandRepository _brandRepository;
        private readonly IMapper _mapper;
...

To this generic handler

public partial class CreateCommand<T> : T, IRequest<Result<int>> where T : class { } 
public class CreateCommandHandler : IRequestHandler<CreateCommand<T>, Result<int>>
{
      private readonly IBaseRepository<T> _repo;
...

But I cannot get generic handler working. How to get it working?

Automatic migrations (contribution)

Hi Mukesh!

I would like to contribute with a feature, if you agree.
The plan is simple, create the database, perform the migrations and seed automaGically at startup.

Tests project

Hi, if the solution has a "tests" project already setup with minimums samples would be very nice.... It will help the dev. in the way how to approach tests in Hexagonal architecture and also it will suggest to dev. to do tests :) ....

Thanks !

Bad ApplicationConnection string in API project

Describe the bug

Really simple one... The Application connection string in the API project appsettings.json is:

"ApplicationConnection": "Data Source=Server=(localdb)\\mssqllocaldb;...

and should be

"ApplicationConnection": "Data Source=(localdb)\\mssqllocaldb;...

(i.e., remove the extra "Server=' bit)

Generally not a big deal as most folks will update these strings, but I was fine using the LocalDB and it took me a bit to realize the problem..

Very nice/awesome example of good ASP.NET core practices by the way!

Connection Already Exist

Describe the bug
InvalidOperationException: There is already an open DataReader associated with this Connection which must be closed first.

To Reproduce
Steps to reproduce the behavior:
Generated a new application with dotnet.
Upgraded to the latest Nuget packages.
Conducted the Migrations to create the new database on my local MSSQL 2019 Server
Tested the Token API Successfully.
Selected the Web as default App and logged in with the default Super Admin User

  1. Go to 'Admin Settings'
  2. Click on 'Users'
  3. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser chrome
  • Version latest

Additional context
Clicking on Roles worked, but the remaining links did not. Same error was generated

Docker configuration

Is your feature request related to a problem? Please describe.
No

Describe the solution you'd like
It would be nice if you could add a docker support to this project

Asp.Net Core 5.0?

There is no 5.0 version of asp.net core
The latest version of .net core is 3.1. There is a whole new framework version of 5.0 and it's called .NET 5

Domain business logic sample

Hi, I think one of the benefits of the Hexagonal architecture is that the business logics is in only one place.... the "Domain" layer. I think it would be nice to have an example (or more) of business logics apply in the "Domain" layer.

Thanks!

Would you consider adding Dapper for the CQRS Queries

You have an excellent article to use Dapper along with EntityFramework Core. Would you consider adding Dapper to your Boilerplate? While I am asking... How about Serilog.sinks.seq, Dapper.FluentMap and Dapper.Logging?

Interface name does not match the file name

Hi, I think there is a small issue: the names have been mixed up in the file:

AspNetCoreHero.Boilerplate.Application/Interfaces/CacheRepositories/IProductCacheRepository.cs

the interface name is "IBrandCacheRepository"

The same thing occured in the file "IBrandCacheRepository.cs"
Thanks!

Enabling refresh token

Hello,
First, thank you for this repository and the great effort you made to make this work.

I am trying to implement refresh-token flow and I can't achieve this. Could you please help me with this?

Regards.

Mohammed

Upgrade to .net6

.net 5 has reached it's end of life per the MS support page

Can you do a new version that uses .net6 so it's current and up to date??

Thanks

GetAllProductQuerry Result problem

Describe the bug
When I try "GetAllProductQuerry" method, the result message " succeeded" always "Fail" in case Data is not null

Screenshots
image

API Response http 401 "You are not Authorized" for all the roles with all permissions.

Describe the bug
Users Can't access the API.

To Reproduce
Steps to reproduce the behavior:

  1. Use Swagger UI to Generate a user token that have superadmin role with all permissions.
  2. Authorize the user
  3. Use one of the GET API endpoints (ex. Brand)

Expected behavior
Return an empty Array of brands.

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Chrome
  • Version [e.g. 22]

Additional context
The UsersToken Database is empty!.

HTML Markup error in views

Describe the bug
In most views where td is used there is an html error, if you open the project in Rider its immediately full of reds :)

To Reproduce
StoreManager.Web/Areas/Catalog/Views/Brand/_ViewAll.cshtml

                <td text-right">

should be

                <td text-right>

No quotes there, thats invalid html :) ..it is in multiple files I used this as an example

Inconsistent naming for UpdateBrandCommand Handler

Describe the bug
This is not so much a bug as a coding mistake.

/Boilerplate/blob/master/AspNetCoreHero.Boilerplate.Application/Features/Brands/Commands/Update/UpdateBrandCommand.cs

This looks like it may have been a copy of UpdateProductCommand.cs that was altered to suit Brand. The handler inside the UpdateBrandCommand is called UpdateProductCommandHandler instead of UpdateBrandCommandHandler.

Block ui

Hi, first of all this template great for asp.net web application, there is one feature request that personally need, can you add a ui blocker like HoldOn js when we click on Save, Edit or Delete button.

Change the delete a:link with a submit button

I'm suggesting that you change the a:href link inside the the delete forms
<a href="javascript:$('#[email protected]').submit();" class="dropdown-item"><i class="fas fa-trash-alt"></i> Delete</a>with a submit button <button type="submit" class="dropdown-item"><i class="fas fa-trash-alt"></i> Delete</button>, because what we have now does show the confirm dialog indeed but when you click any of the confirmation dialog buttons the result is just a redirection to empty content.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.