public async Task <bool> End(int doorId, int IntimidatorId) { IntimidatorIntimidation intimidation = await new IntimidationData(_context).SelectAsync(Time.GetSystemNow().Date, doorId, IntimidatorId); if (intimidation == null) { return(false); } intimidation.Depleted = true; return(await new IntimidationData(_context).End(intimidation)); }
public async Task <bool> Start(IntimidatorIntimidation intimidatorIntimidation) { try { _context.IntimidatorIntimidations.Add(intimidatorIntimidation); int affectedRows = await _context.SaveChangesAsync(); return(affectedRows > 0); } catch (Exception) { return(false); } }