Application service base class for CRUD operations
See original GitHub issueWhat do you think about creating an application service base class or interface for CRUD operations
example:
public interface IEmployeesService : ICRUDService<EmployeeDto>
{
public Create(EmployeeDTO employee){...}
}
...
Issue Analytics
- State:
- Created 8 years ago
- Comments:14 (6 by maintainers)
Top Results From Across the Web
How can I implement CRUD operations in a base class for ...
I've set up a BaseObject Class and a IBaseRepository Interface to handle the most basic operations so I don't have to repeat myself...
Read more >[Updated] Building a Generic Service for CRUD Operations ...
In this article, we will explore how to create a generic service class in a C# .NET Core application to handle CRUD (Create,...
Read more >CRUD Operations Using the Generic Repository Pattern ...
This article introduces use of the Generic Repository Pattern and Dependency Inversion Principle With IoC Container and DI in MVC for CRUD ......
Read more >Creating a simple data-driven CRUD microservice
This section outlines how to create a simple microservice that performs create, read, update, and delete (CRUD) operations on a data source.
Read more >application service documentation
The base CRUD class automatically checks permissions if you set them. Here, you can set it in the constructor: Copy. public class TaskAppService...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Mini Documentation
An application service for
Message
entity which usesMessageDto
as DTO for all methods:AsyncCrudAppService’s all methods are async. You can derive from CrudAppService if you prefer sync methods instead of async.
MessageDto
is like that:If you want to define interface for your application service:
Then you can implement
IMessageAppService
forMessageAppService
without any code change.In this sample, I used
MessageDto
for all methods. But we could specifyCreateInput
,UpdateInput
,DeleteInput
types and specify an input type forGetAll
method (default input type isPagedAndSortedResultRequestInput
, but your custom input type may not use paging/sorting). We can also override all base methods and customize mapping (which uses IObjectMapper by default).Yes, I know 😃 but I already use CrudAppService, which is not -Async. Though, its methods are async-ready, so I want to have strong reason to rewrite my code to using AsyncCrudAppService