public static DA.Task ToEntity(this DT.Task source) { if (source == null) { return(null); } var result = new DA.Task(); source.CopyToEntity(result); return(result); }
public void UpdateTask(DT.Task taskDto) { RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client, HiveRoles.Slave); AuthorizationManager.AuthorizeForTask(taskDto.Id, Permission.Full); var pm = PersistenceManager; using (new PerformanceLogger("UpdateTask")) { var taskDao = pm.TaskDao; pm.UseTransaction(() => { var task = taskDao.GetById(taskDto.Id); taskDto.CopyToEntity(task); pm.SubmitChanges(); }); } }