public void Update(DalTask entity) { Task toDoForm = MapperDomainConfiguration.MapperInstance.Map <DalTask, Task>(entity); context.Set <Task>() .Where(form => form.Id == toDoForm.Id) .Update(updated => toDoForm); }
public void Delete(int id) { Task task = new Task { Id = id }; context.Set <Task>().Attach(task); context.Set <Task>().Remove(task); }
public static BllTask GetBllEntity(this ORM.Task ormEntity) { return(new BllTask() { Id = ormEntity.Id, ToDoId = ormEntity.ToDoId, UserId = ormEntity.UserId, IsCompleted = ormEntity.IsCompleted, Name = ormEntity.Name, IsDeleted = ormEntity.IsDeleted }); }
public void Create(DalTask entity) { Task task = MapperDomainConfiguration.MapperInstance.Map <DalTask, Task>(entity); context.Set <Task>().Add(task); }
public DalTask Get(int id) { Task found = context.Set <Task>().FirstOrDefault(form => form.Id == id); return(found == null ? null : MapperDomainConfiguration.MapperInstance.Map <Task, DalTask>(found)); }