public bool Add(OwnerViewModel objAdd) { var newRow = new People { Name = objAdd.Name, Last1 = objAdd.Last1, Last2 = objAdd.Last2 }; Context.People.Add(newRow); Context.SaveChanges(); return(true); }
public bool Edit(OwnerViewModel val) { var model = Context.People.FirstOrDefault(e => e.ID == val.ID); if (model == null) { throw new ArgumentNullException(nameof(model)); } model.Name = val.Name; model.Last1 = val.Last1; model.Last2 = val.Last2; Context.SaveChanges(); return(true); }