Пример #1
0
        public IActionResult Add([FromBody] ElectricityDTO command)
        {
            var item = new Electricity();;

            mapper.MapToModel(command, item);

            _repository.Insert(item);
            return(Created(String.Empty, item));
        }
Пример #2
0
        public IActionResult Update([FromBody] ElectricityDTO command)
        {
            var item = _repository.Get(command.Id);

            mapper.MapToModel(command, item);

            _repository.Update(item);

            return(Ok());
        }