public void Update(UpdateTimeVideoCommand command) { if (!this.UpdateTimeVideoScopeIsValid(command)) { return; } this.Time = command.Time; }
public Task <HttpResponseMessage> Put(int id, [FromBody] dynamic body) { var command = new UpdateTimeVideoCommand( idTimeVideo: id, time: (int)body.time ); var time = _service.Update(command); return(CreateResponse(HttpStatusCode.OK, time)); }
public TimeVideo Update(UpdateTimeVideoCommand command) { var time = _repository.GetById(command.IdTimeVideo); time.Update(command); _repository.Update(time); if (Commit()) { return(time); } return(null); }
public static bool UpdateTimeVideoScopeIsValid(this TimeVideo timeVideo, UpdateTimeVideoCommand newTimeVideo) { return(AssertionConcern.IsSatisfiedBy( AssertionConcern.AssertTrue(!(newTimeVideo.Time == 0), "O tempo é obrigatório") )); }