Пример #1
0
        public async Task <ActionResult <IEnumerable <DataModels.Customers> > > GetCustomers()
        {
            var aux = new BS.Customers(_context).GetAll();

            var mapaux = _mapper.Map <IEnumerable <data.Customers>, IEnumerable <datamodels.Customers> >(aux).ToList();

            return(mapaux);
            //return await new Solution.BS.Foci(_context).GetAllWithAsync();
        }
Пример #2
0
        public async Task <ActionResult <IEnumerable <DataModels.Customer> > > GetCustomers()
        {
            // carga de datos
            var aux = new BS.Customers(_context).GetAll().ToList();

            //implementacion del automapper
            var mappaux = _mapper.Map <IEnumerable <data.Customers>, IEnumerable <DataModels.Customer> >(aux).ToList();

            return(mappaux.ToList());
        }
Пример #3
0
        public async Task <ActionResult <DataModels.Customers> > GetCustomers(int id)
        {
            var customers = new BS.Customers(_context).GetOneById(id);
            var mapaux    = _mapper.Map <data.Customers, datamodels.Customers>(customers);

            if (customers == null)
            {
                return(NotFound());
            }

            return(mapaux);
        }
Пример #4
0
        public async Task <ActionResult <DataModels.Customer> > GetCustomers(int id)
        {
            var customers = new BS.Customers(_context).GetOneById(id);

            //implementacion del automapper
            var mappaux = _mapper.Map <data.Customers, DataModels.Customer>(customers);

            if (mappaux == null)
            {
                return(NotFound());
            }

            return(mappaux);
        }