public static DalToDo ToDalToDo(this DalToDo task) { return(new DalToDo { Author = task.Author, Content = task.Content, Id = task.Id, Name = task.Name }); }
public void Add(DalToDo task) { try { uow.Set <DalToDo>().Add(task); uow.SaveChanges(); } catch { throw new Exception(); } }
public void Update(int id, DalToDo task) { var toDo = GetById(id); if (!ReferenceEquals(task.Author, null)) { toDo.Author = task.Author; } if (!ReferenceEquals(task.Content, null)) { toDo.Content = task.Content; } if (!ReferenceEquals(task.Name, null)) { toDo.Name = task.Name; } }