public VinylDTO GetVinyl(int id) { if (id < 0) { throw new ArgumentOutOfRangeException(); } return(DTOMapper.Map(vinylsDataBase.Get(id))); }
public IEnumerable <ClientDTO> GetClients() { IEnumerable <IClient> clients = clientDataBase.GetAll(); List <ClientDTO> clientsDTO = new List <ClientDTO>(); foreach (var client in clients) { clientsDTO.Add(DTOMapper.Map(client)); } return(clientsDTO); }
public IEnumerable <OrderDTO> GetOrders() { IEnumerable <IOrder> orders = orderDataBase.GetAll(); List <OrderDTO> ordersDTO = new List <OrderDTO>(); foreach (var order in orders) { ordersDTO.Add(DTOMapper.Map(order)); } return(ordersDTO); }
public IEnumerable <VinylDTO> GetVinyls() { IEnumerable <IVinyl> vinyls = vinylsDataBase.GetAll(); List <VinylDTO> vinylsDTOs = new List <VinylDTO>(); foreach (var vinyl in vinyls) { vinylsDTOs.Add(DTOMapper.Map(vinyl)); } return(vinylsDTOs); }
public ClientDTO GetClient(int id) { return(DTOMapper.Map(clientDataBase.Get(id))); }
public OrderDTO GetOrder(int id) { return(DTOMapper.Map(orderDataBase.Get(id))); }
public async Task Unsubscribe(VinylDTO vinyl) { await vinylsDataBase.Unsubscribe(DTOMapper.Map(vinyl)); }
public bool AddVinyl(VinylDTO newVinyl) { vinylsDataBase.Add(DTOMapper.Map(newVinyl)); OnRefreshVinyls?.Invoke(); return(true); }