public virtual async Task Delete(T entity) { if (entity == null) { throw new ArgumentNullException("entity"); } entities.Remove(entity); await context.SaveChangesAsync(); }
public async Task Update(Contact entity) { if (entity == null) { throw new ArgumentNullException("entity"); } Contact contact = this.context.Contacts.Find(entity.Id); //contact.IsActive = true; contact.LastName = entity.LastName; contact.ModifiedOn = DateTime.Now; this.context.Contacts.Update(contact); await context.SaveChangesAsync(); }
public async Task Update(Note entity) { if (entity == null) { throw new ArgumentNullException("entity"); } Note note = this.context.Notes.Find(entity.Id); note.IsActive = true; note.ModifiedOn = DateTime.Today; note.Subject = entity.Subject; note.Description = entity.Description; note.RemindMeOn = entity.RemindMeOn; this.context.Notes.Update(note); await context.SaveChangesAsync(); }