public bool Create(Account acct) { try { IAccountRepository accountRepo = new AccountsRepository(); accountRepo.UpsertAccount(acct); return true; } catch { throw new HttpResponseException(HttpStatusCode.InternalServerError); } }
public bool CreateAccount(Account acct) { try { IAccountRepository accountRepo = new AccountsRepository(); accountRepo.UpsertAccount(acct); return true; } catch { throw new HttpResponseException(HttpStatusCode.NotFound); } }
protected AccountsRepository PopulateDummyAccounts() { AccountsRepository repo = new AccountsRepository(); repo.DeleteAll(); //arrange Account[] accounts = { new Account {FirstName="jones", LastName="pavan", EmailAddress="*****@*****.**", Password="******", Status= Account.AccountStatus.Active}, new Account {FirstName="danielle", LastName="pavan", EmailAddress="*****@*****.**", Password="******", Status= Account.AccountStatus.Active}, new Account {FirstName="isabella", LastName="pavan", EmailAddress="*****@*****.**", Password="******", Status= Account.AccountStatus.Active}, new Account {FirstName="gabriel", LastName="pavan", EmailAddress="*****@*****.**", Password="******", Status= Account.AccountStatus.Active} }; foreach (Account a in accounts) repo.UpsertAccount(a); return repo; }