Exemplo n.º 1
0
        public BarberEquipment Create(BarberEquipment model)
        {
            _ctx.BarberEquipments.Add(model);
            _ctx.SaveChanges();

            return(model);
        }
Exemplo n.º 2
0
        public BarberEquipment Update(BarberEquipment model)
        {
            var entity = _ctx.BarberEquipments.FirstOrDefault(x => x.Id == model.Id);

            entity.Name     = model.Name;
            entity.Price    = model.Price;
            entity.Quantity = model.Quantity;

            _ctx.SaveChanges();

            return(model);
        }
        public BarberEquipmentModel GetById(int id)
        {
            BarberEquipment model = _barberEquipmentRepository.GetById(id);

            return(_mapper.Map <BarberEquipmentModel>(model));
        }