public async Task DeleteAsync(OvergroundCanalLaying entity) { try { var temp = await GetAsync(entity.D); if (temp == null) { throw new DalException(DalException.ErrorType.NorFoundDiameter, DalException.LayingType.OverGroundCanalLaying, "Deleting UndergroundLaying entity exception"); } _context.Entry(temp).State = EntityState.Deleted; } catch (Exception e) { throw new DalException(DalException.ErrorType.DatabaseException, DalException.LayingType.OverGroundCanalLaying, e.Message, e.InnerException); } }
public async Task <OvergroundCanalLaying> UpdateAsync(OvergroundCanalLaying entity) { try { var temp = await GetAsync(entity.D); temp.Q10 = entity.Q10; temp.Q60 = entity.Q60; temp.Q160 = entity.Q160; temp.Q260 = entity.Q260; temp.Q360 = entity.Q360; return(temp); } catch (Exception e) { throw new DalException(DalException.ErrorType.NorFoundDiameter, DalException.LayingType.OverGroundCanalLaying, e.Message, e.InnerException); } }
public async Task <OvergroundCanalLaying> AddAsync(OvergroundCanalLaying entity) { try { var temp = await GetAsync(entity.D); if (temp != null) { throw new DalException(DalException.ErrorType.ExistDiameter, DalException.LayingType.OverGroundCanalLaying, "Create UndergroundLaying entity exception"); } _context.OvergroundCanalLaying.Add(entity); return(entity); } catch (Exception e) { throw new DalException(DalException.ErrorType.DatabaseException, DalException.LayingType.OverGroundCanalLaying, e.Message, e.InnerException); } }