/// <summary> /// Create lot /// </summary> /// <param name="e">Lot to create</param> /// <returns>Id of the created lot</returns> public async Task <int> Create(BllLot e) { if (e == null) { throw new ArgumentNullException(nameof(e)); } return(await Context.LotsRepository.Create(e.ToDalLot())); }
/// <summary> /// Update lot info /// </summary> /// <param name="e">Lot with new information</param> public async Task Update(BllLot e) { if (e == null) { throw new ArgumentNullException(nameof(e)); } var dbLot = await Context.LotsRepository.GetById(e.Id); if (dbLot != null) { await Context.LotsRepository.Update(e.ToDalLot()); } else { throw new ArgumentOutOfRangeException(nameof(e)); } }