public TurmaViewModel AtualizarTurma(TurmaViewModel model) { BeginTransaction(); var turma = TurmaAdapter.ToDomainModel(model); _turmaservice.AtualizarTurma(turma); Commit(); return(model); }
public TurmaViewModel AdicionarTurma(TurmaViewModel model) { var turma = TurmaAdapter.ToDomainModel(model); _turmaservice.AdicionarTurma(turma); model.ValidationResult = turma.ValidationResult; if (!turma.ValidationResult.IsValid) { return(model); } Commit(); return(model); }