public void Update(W***e entity) { FirstName = entity.FirstName; LastName = entity.LastName; Age = entity.Age; PimpId = entity.Pimp?.Id ?? entity.PimpId; PricePerHour = entity.PricePerHour; }
public void ChangeWhore(W***e w***e) { using (var ctxt = GetContext()) { var oldItem = ctxt.W****s.FirstOrDefault(x => x.Id == w***e.Id); oldItem?.Update(w***e); ctxt.SaveChanges(); } }
public void AddWhore(W***e w***e) { using (var ctxt = GetContext()) { if (w***e.Pimp != null) { w***e.PimpId = w***e.Pimp.Id; } w***e.Pimp = null; //TODO: create best resolve of this problem ctxt.W****s.Add(w***e); ctxt.SaveChanges(); } }