示例#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);
        }