public static void Delete(int id, MataDBEntities db) { using (var ts = db.Database.BeginTransaction()) { try { var account = db.Account.Single(q => q.ID == id); TokenBL.Delete(account.ID, db); db.Account.Remove(account); db.SaveChanges(); ts.Commit(); } catch (Exception) { ts.Rollback(); throw; } } }
public static AccountDTO Get(string tokenString, MataDBEntities db) { var accountID = TokenBL.Get(tokenString, db); return(Get(accountID, db)); }