public async Task UpdatePerson(Person updateData) { using (var context = new AF_Context()) { try { Person per = context.People.First(a => a.PersonId == updateData.PersonId); context.Entry(per).CurrentValues.SetValues(updateData); await context.SaveChangesAsync(); } catch (Exception ex) { throw ex; } } }
public async Task UpdatePerson(Person updateData) { throw new NotImplementedException(); }
public async Task AddPerson(Person newPerson) { using (var context = new AF_Context()) { try { context.People.Add(newPerson); int recordsAffected = await context.SaveChangesAsync(); } catch (Exception ex) { throw ex; } } }
public async Task AddPerson(Person newPerson) { throw new NotImplementedException(); }