Last active
May 2, 2020 15:25
-
-
Save WiktorNowikow/977c03fdaafe7e379f008bedbcbabad5 to your computer and use it in GitHub Desktop.
Generic request for MediatR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GetGlossaryListQuery<TEntity> :IRequest<IEnumerable> | |
where TEntity : BaseTableModel | |
{ | |
public class GetGlossaryListQueryHandler : BaseEnsiHandler, IRequestHandler<GetGlossaryListQuery<TEntity>, IEnumerable> | |
{ | |
public async Task<IEnumerable> Handle(GetGlossaryListQuery<TEntity> request, CancellationToken cancellationToken) | |
{ | |
} | |
} | |
} | |
//dependency injection | |
services.AddTransient(typeof(IRequestHandler<,>), typeof(GetGlossaryListQuery<>.GetGlossaryListQueryHandler)); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment