Esempio n. 1
0
        public HistoryEquipment Create(CreateHistoryEquipmentCommand command)
        {
            var history = new HistoryEquipment(command.IdVideo, command.IdEquipment, command.IdCompany, command.Plan, command.Action, command.Value);

            history.Create();
            _repository.Create(history);

            if (Commit())
            {
                return(history);
            }

            return(null);
        }
Esempio n. 2
0
        public Task <HttpResponseMessage> Post([FromBody] dynamic body)
        {
            var command = new CreateHistoryEquipmentCommand(
                idVideo: (int)body.idVideo,
                idEquipment: (int)body.idEquipment,
                value: (decimal)body.value,
                idCompany: (int)body.idCompany,
                plan: (string)body.plan
                );

            var history = _service.Create(command);

            return(CreateResponse(HttpStatusCode.Created, history));
        }