* Added new Entities and Dtos
* Mapping new classes * Added new services and Controllers in API
This commit is contained in:
13
SytelineSaAppEfDataModel/Services/CustomerService.cs
Normal file
13
SytelineSaAppEfDataModel/Services/CustomerService.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using AutoMapper;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
|
||||
namespace SytelineSaAppEfDataModel.Services;
|
||||
|
||||
public class CustomerService(SytelineSaAppDbContext context, IMapper mapper) : ICustomerService
|
||||
{
|
||||
public async Task<IList<CustomerDto>> GetAllCustomers()
|
||||
{
|
||||
return await context.Customers.Select(x => mapper.Map<CustomerDto>(x)).ToListAsync();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user