public void SaveGodaddyAccount(DAS.Domain.GoDaddy.Users.GoDaddyAccount account) { var acc = new GoDaddyAccount(); var godaddy = Context.GoDaddyAccount.ToList(); acc.FromDomainObject(account); var existingAccount = Context.GoDaddyAccount.FirstOrDefault(x => x.GoDaddyUsername == account.Username); if (existingAccount != null) { acc.AccountID = Context.Users.First(x => x.Username == account.Username).UserID; Context.GoDaddyAccount.AddOrUpdate(acc); } else { existingAccount = new GoDaddyAccount { GoDaddyPassword = account.Password, Verified = account.Verified, GoDaddyUsername = account.Username, AccountID = account.AccountId, UserID = account.UserID }; Context.GoDaddyAccount.AddOrUpdate(existingAccount); } Context.Save(); }
public void FromDomainObject(DAS.Domain.GoDaddy.Users.GoDaddyAccount account) { AccountID = account.AccountId; GoDaddyUsername = account.Username; GoDaddyPassword = account.Password; Verified = account.Verified; UserID = account.UserID; }