public async Task <(DailyExtractLot, bool)> CreateNewDailyExtractLot(string name, Guid managementCategoryId, int headsAmount) { var isNewDailyExtractLot = false; DailyExtractLot dailyExtractLot = null; dailyExtractLot = await _dailyExtractLotRepository.GetDailyExtractLotByManagementCategoryId(managementCategoryId); if (dailyExtractLot != null) { dailyExtractLot.IncreateHeadsAmount(headsAmount); _dailyExtractLotRepository.Update(dailyExtractLot); } else { dailyExtractLot = new DailyExtractLot(name, managementCategoryId, headsAmount); _dailyExtractLotRepository.Add(dailyExtractLot); isNewDailyExtractLot = true; } return(dailyExtractLot, isNewDailyExtractLot); }
public void Update(DailyExtractLot dailyExtractLot) { DbSet.Update(dailyExtractLot); }
public void Add(DailyExtractLot dailyExtractLot) { DbSet.Add(dailyExtractLot); }