Exemplo n.º 1
0
        public VinylDTO GetVinyl(int id)
        {
            if (id < 0)
            {
                throw new ArgumentOutOfRangeException();
            }

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