public static Task ToModel(this TaskViewModel viewModel) { var task = new Task(); task.InjectFrom(viewModel); return task; }
public void Update(Task task) { if (this.Validate(task)) { this._taskRepository.Update(task); this._taskRepository.Commit(); } }
public void Add(Task task) { var isTeacherExist = this._teacherManager.IsExist(task.TeacherID); var isGroupExist = this._groupManager.IsExist(task.GroupID); var isTypeOfTask = this._typeOfTaskManager.IsExist(task.TypeID); if (this.Validate(task) && isTeacherExist && isGroupExist && isTypeOfTask) { this._taskRepository.Add(task); this._taskRepository.Commit(); } }
private bool Validate(Task entity) { return true; }