public async Task <int> UpdateSubgroupNo(SubGroupNumber sub, int id) { SubGroupNumber s = _context.SubGroupNumbers.Where(e => e.Id == id).First(); s.SubGroupNum = sub.SubGroupNum; return(await _context.SaveChangesAsync()); }
public async Task <bool> AddSubGroupNumber(SubGroupNumber subGroup) { _context.SubGroupNumbers.Add(subGroup); int result = await _context.SaveChangesAsync(); if (result > 0) { return(true); } return(false); }