public void UpdatePerson(PersonViewModel personViewModel) { UN_Persons per = this._databaseContext.UN_Persons.Single(a => a.id_person == personViewModel.id_person); per.Name = personViewModel.Name; per.Address = personViewModel.Address; per.EGN = personViewModel.EGN; per.GSM = personViewModel.GSM; this.Save(); }
public void AddPerson(PersonViewModel personViewModel) { UN_Persons per = new UN_Persons(); per.Name = personViewModel.Name; per.Address = personViewModel.Address; per.EGN = personViewModel.EGN; per.GSM = personViewModel.GSM; this._databaseContext.UN_Persons.Add(per); this.Save(); }