public IAsyncResult BeginSaveRole(Role role, Identification identification, AsyncCallback callback, object state) { logger.Log(LogLevel.Trace, AppLib.GetCaller(logger)); if (AppLib.VerifyToken(identification.Token) <= 0) { throw new FaultException<ServiceFault>(new ServiceFault("Invalid Authentication", "Authorization"), new FaultReason("Unauthorized")); } var task = Task<Guid>.Factory.StartNew(process => DoSaveRole(role, identification), state); return task.ContinueWith(res => callback(task)); }
public SaveRoleRequest(Role role) { this.role = role; }
public Guid DoSaveRole(Role role, Identification identification) { logger.Log(LogLevel.Trace, AppLib.GetCaller(logger)); using (SystemDAO dao = new SystemDAO()) { return dao.SaveRole(role, identification.Token); } }