public async Task <int> Update(Exercise exercise) { if (exercise == null || !_mesoService.GetUserMesocycles().Select(x => x.Id).Any(y => y == exercise.MesoId)) { throw new NullReferenceException("Exercise could not be found"); } _context.Update(exercise); return(await _context.SaveChangesAsync()); }
public async Task Update(Meso meso) { _context.Update(meso); await _context.SaveChangesAsync(); }