Beispiel #1
0
        public async Task <IEnumerable <VinylDTO> > GetAllVinyls()
        {
            var vinyls = vinylDataBase.Get();

            List <VinylDTO> vinylsList = new List <VinylDTO>();

            foreach (IVinyl v in vinyls)
            {
                vinylsList.Add(DTOMapper.Map(v));
            }

            return(await Task.FromResult(vinylsList));
        }
Beispiel #2
0
        public async Task <IEnumerable <ClientDTO> > GetAllClients()
        {
            var clients = clientDataBase.GetAll();

            List <ClientDTO> clientsList = new List <ClientDTO>();

            foreach (var c in clients)
            {
                clientsList.Add(DTOMapper.Map(c));
            }

            return(await Task.FromResult(clientsList));
        }
Beispiel #3
0
        public async Task <IEnumerable <OrderDTO> > GetAllOrders()
        {
            var orders = orderDataBase.GetAll();

            List <OrderDTO> ordersList = new List <OrderDTO>();

            foreach (var o in orders)
            {
                ordersList.Add(DTOMapper.Map(o));
            }

            return(await Task.FromResult(ordersList));
        }
Beispiel #4
0
 public async Task <VinylDTO> GetVinyl(int id)
 {
     return(await Task.FromResult(DTOMapper.Map(vinylDataBase.Get(id))));
 }
Beispiel #5
0
        public async Task <bool> AddVinyl(VinylDTO vinyl)
        {
            IVinyl vinylObj = DTOMapper.Map(vinyl);

            return(await Task.FromResult(vinylDataBase.AddStock(vinylObj.ID, vinylObj.InStock)));
        }
Beispiel #6
0
 public async Task <bool> AddNewVinyl(VinylDTO vinyl)
 {
     return(await Task.FromResult(vinylDataBase.AddNew(DTOMapper.Map(vinyl))));
 }
Beispiel #7
0
 public async Task <bool> UpdateClient(ClientDTO client, int id)
 {
     return(await Task.FromResult(clientDataBase.Update(DTOMapper.Map(client), id)));
 }
Beispiel #8
0
 public async Task <ClientDTO> GetClient(int id)
 {
     return(await Task.FromResult(DTOMapper.Map(clientDataBase.Get(id))));
 }
Beispiel #9
0
 public void OnNext(IVinyl value)
 {
     onNext?.Invoke(DTOMapper.Map(value));
 }
Beispiel #10
0
 public async Task <bool> UpdateOrder(OrderDTO order, int id)
 {
     return(await Task.FromResult(orderDataBase.Update(DTOMapper.Map(order), id)));
 }
Beispiel #11
0
 public async Task <OrderDTO> GetOrder(int id)
 {
     return(await Task.FromResult(DTOMapper.Map(orderDataBase.Get(id))));
 }