Ejemplo n.º 1
0
        public virtual async Task UpdateImgCategoryAsync(ImgCategoryEditDto input)
        {
            //TODO:更新前的逻辑判断,是否允许更新

            var entity = await _imgCategoryRepository.GetAsync(input.Id.Value);

            input.MapTo(entity);

            await _imgCategoryRepository.UpdateAsync(entity);
        }
Ejemplo n.º 2
0
        public virtual async Task <ImgCategoryEditDto> CreateImgCategoryAsync(ImgCategoryEditDto input)
        {
            //TODO:新增前的逻辑判断,是否允许新增

            var entity = input.MapTo <ImgCategory>();

            entity = await _imgCategoryRepository.InsertAsync(entity);

            return(entity.MapTo <ImgCategoryEditDto>());
        }