Beispiel #1
0
        public VinylDTO GetVinyl(int id)
        {
            if (id < 0)
            {
                throw new ArgumentOutOfRangeException();
            }

            return(DTOMapper.Map(vinylsDataBase.Get(id)));
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
 public ClientDTO GetClient(int id)
 {
     return(DTOMapper.Map(clientDataBase.Get(id)));
 }
Beispiel #6
0
 public OrderDTO GetOrder(int id)
 {
     return(DTOMapper.Map(orderDataBase.Get(id)));
 }
Beispiel #7
0
 public async Task Unsubscribe(VinylDTO vinyl)
 {
     await vinylsDataBase.Unsubscribe(DTOMapper.Map(vinyl));
 }
Beispiel #8
0
 public bool AddVinyl(VinylDTO newVinyl)
 {
     vinylsDataBase.Add(DTOMapper.Map(newVinyl));
     OnRefreshVinyls?.Invoke();
     return(true);
 }