public async Task PatchTaskAsync(int id, string prop, object value) { var task = await db.TaskItems.FindAsync(id); task.GetType().GetProperty(prop).SetValue(task, value); db.Entry(task).State = EntityState.Modified; await db.SaveChangesAsync(); }
public async Task PatchSubTaskAsync(int id, string prop, object value) { var entity = await db.SubTaskItems.FindAsync(id); entity.GetType().GetProperty(prop).SetValue(entity, value); db.Entry(entity).State = EntityState.Modified; await db.SaveChangesAsync(); }