Esempio n. 1
0
        public void UpdateAccount(WhatYouGotLibrary.Models.Account account)
        {
            Entities.Account currentAccount = _context.Account.Find(account.Id);
            Entities.Account newAccount     = Mapper.Map(account);

            _context.Entry(currentAccount).CurrentValues.SetValues(newAccount);
        }
 public static Entities.Account Map(WhatYouGotLibrary.Models.Account account)
 {
     return(new Entities.Account
     {
         Id = account.Id,
         Username = account.Username,
         Passphrase = account.Passphrase,
         FirstName = account.FirstName,
         LastName = account.LastName,
         Email = account.Email
     });
 }
Esempio n. 3
0
 public void AddAccount(WhatYouGotLibrary.Models.Account account)
 {
     Entities.Account newAccount = Mapper.Map(account);
     _context.Add(newAccount);
 }