public bool Create(Time entity) { if (Validation(entity, false)) { _timeRepository.Create(entity); return(true); } return(false); }
public ICommandResult Handle(CreateTimeCommand command) { command.Validate(); if (!command.IsValid) { return(new GenericCommandResult(false, "Error: ", command.Notifications)); } var time = new Time(command.Project_Id, command.User_Id, command.Started_at, command.Ended_at); _repository.Create(time); return(new GenericCommandResult(true, "Create time with success!", time)); }