コード例 #1
0
 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;
         }
     }
 }
コード例 #2
0
 public async Task UpdatePerson(Person updateData)
 {
     throw new NotImplementedException();
 }
コード例 #3
0
 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;
         }
     }
 }
コード例 #4
0
 public async Task AddPerson(Person newPerson)
 {
     throw new NotImplementedException();
 }