| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- using Karsha_Site.Application.Interfaces.Contexts;
- using Karsha_Site.Application.Services.Costomers.Queries.GetCustomers;
- using Karsha_Site.Common.Dto;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
-
- namespace Karsha_Site.Application.Services.Common.Queries.GetCustomer
- {
- public interface IGetCustomerService
- {
- ResultDto<List<GetAboutAddressDto>> Execute();
- }
-
- public class GetCustomerService : IGetCustomerService
- {
- private readonly IDataBaseContext _context;
- public GetCustomerService(IDataBaseContext context)
- {
- _context = context;
- }
- public ResultDto<List<GetAboutAddressDto>> Execute()
- {
-
- var customers = _context.Customers
- .ToList()
- .Select(p => new GetAboutAddressDto
- {
- ID = p.ID,
- FullName = p.FullName,
- Image = p.Image,
- Link = p.Link,
- }).ToList();
-
- return new ResultDto<List<GetAboutAddressDto>>()
- {
- Data = customers,
- IsSuccess = true,
-
- };
- }
- }
-
-
- }
|