Пример #1
0
        public async Task UpdateSectionType(SectionTypeDto pSectionType)
        {
            SectionTypeEntity lSectionTypeEntity = await this._sectionTypeRepository.GetById(pSectionType.Id);

            Mapping.Mapper.Map <SectionTypeDto, SectionTypeEntity>(pSectionType, lSectionTypeEntity);
            await this._sectionTypeRepository.Update(lSectionTypeEntity);
        }
Пример #2
0
        public async Task <SectionTypeEntity> Add(SectionTypeEntity pEntity)
        {
            await this.dbContext.SectionTypes.AddAsync(pEntity);

            await this.dbContext.SaveChangesAsync();

            return(pEntity);
        }
Пример #3
0
 public async Task Delete(SectionTypeEntity pEntity)
 {
     this.dbContext.SectionTypes.Remove(pEntity);
     await this.dbContext.SaveChangesAsync();
 }
Пример #4
0
 public async Task Update(SectionTypeEntity pEntity)
 {
     this.dbContext.SectionTypes.Update(pEntity);
     await this.dbContext.SaveChangesAsync();
 }
Пример #5
0
        public async Task <SectionTypeDto> GetSectionTypeById(int id)
        {
            SectionTypeEntity lSectionTypeEntity = await this._sectionTypeRepository.GetById(id);

            return(Mapping.Mapper.Map <SectionTypeDto>(lSectionTypeEntity));
        }