public void Update(OwnerAccount accountChange) { var account = context.Owners.Attach(accountChange); account.State = Microsoft.EntityFrameworkCore.EntityState.Modified; context.SaveChanges(); }
public OwnerAccount GetAnOwnerEmailPass(string email, string password) { OwnerAccount account = context.Owners.Where(a => a.UserEmail.Equals(email)).FirstOrDefault(); if (account == null || !encryption.Authenticate(password, account.UserPassword)) { // Owner does not exist return(null); } else { // Owner Exists return(account); } }
public bool CheckOwner(OwnerAccount accountCheck) { OwnerAccount account = context.Owners.Where(a => a.UserEmail.Equals(accountCheck.UserEmail)).FirstOrDefault(); if (account == null || !encryption.Authenticate(accountCheck.UserPassword, account.UserPassword)) { // Owner does not exist return(false); } else { // Owner Exists return(true); } }
public void Delete(OwnerAccount account) { context.Owners.Remove(account); context.SaveChanges(); }
public void Add(OwnerAccount account) { account.UserPassword = encryption.HashPassword(account.UserPassword); context.Owners.Add(account); context.SaveChanges(); }