Contracts for the service layer of any project.
- You must have Visual Studio 2022 Community or higher.
- The dotnet cli is also highly recommended.
The most notable types in this assembly include:
IQueryService<T>
: matches the R in CRUD operatorsICommandService<T>
: matches the CUD in CRUD operationsIService<T>
: Defines the capabilities of bothIQueryService<T>
andICommandService<T>
IServiceLocator
: Defines how to instantiate service class instances
- Run dotnet restore
- Run dotnet build
- Run dotnet test
Use the package manager NuGet to install Dime.System:
dotnet add package Dime.Services
using Dime;
public class CustomerService : ICustomerService<Customer>
{
public async Task<IEnumerable<CustomerDto>> GetAllAsync<CustomerDto>()
{
IEnumerable<Customer> customers = await this.Context.Customers.ToListAsync();
return customers.Select(x => this.Mapper.Map<CustomerDto>(x));
}
}
Pull requests are welcome. Please check out the contribution and code of conduct guidelines.