public ProfileModel(IProfileAdapter adapter) { Id = adapter.Id; Name = adapter.Name; Accounts = new List <AccountModel>(); if (adapter.AccountAdapters != null) { foreach (var item in adapter.AccountAdapters) { Accounts.Add(new AccountModel(item)); } } }
public void Update(IProfileAdapter item) { Profile profile = new Profile(item); _db.Entry(profile).State = EntityState.Modified; }
public void Create(IProfileAdapter item) { Profile profile = new Profile(item); _db.Profiles.Add(profile); }