public List<Account> GetAccount(Account account) { var accounts = (from p in context.Accounts where p.Name == account.Name && p.CompanyID==account.CompanyID select p).ToList(); return accounts; }
public void UpdateAccount(Account account) { try { var currentAccount = context.Accounts.Find(account.AccountID); context.Entry(currentAccount).CurrentValues.SetValues(account); SaveChanges(); } catch (Exception ex) { throw ex; } }
public long InsertAccount(Account account) { context.Entry(account).State = EntityState.Added; SaveChanges(); return account.AccountID; }