Exemplo n.º 1
0
 public bool Create(Account acct)
 {
     try
     {
         IAccountRepository accountRepo = new AccountsRepository();
         accountRepo.UpsertAccount(acct);
         return true;
     }
     catch
     {
         throw new HttpResponseException(HttpStatusCode.InternalServerError);
     }
 }
Exemplo n.º 2
0
 public bool CreateAccount(Account acct)
 {
     try
     {
         IAccountRepository accountRepo = new AccountsRepository();
         accountRepo.UpsertAccount(acct);
         return true;
     }
     catch
     {
         throw new HttpResponseException(HttpStatusCode.NotFound);
     }
 }
Exemplo n.º 3
0
        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;
        }