public DraftStatusObj SetNextDraftStatusObj(DraftStatusObj toSet) { DraftStatusObj toRet = null; lock (_DraftLock) { var allNextStatus = from t in db.DraftStatus where t.ID == 2 select t; DraftStatus next = allNextStatus.First(); next.Status = toSet.Status; next.Time = DateTime.Now; // Commit all changes to the DB db.SubmitChanges(); toRet = new DraftStatusObj(next); } return toRet; }
public DraftStatusObj Post(DraftStatusObj newStatus) { DraftUser user = DraftAuthentication.AuthenticateRequest(Request, 1); return this.dataSource.SetNextDraftStatusObj(newStatus); }