예제 #1
0
        public virtual async Task UpdateIndustryAsync(IndustryEditDto input)
        {
            //TODO:更新前的逻辑判断,是否允许更新

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

            input.MapTo(entity);

            await _industryRepository.UpdateAsync(entity);
        }
예제 #2
0
        public virtual async Task <IndustryEditDto> CreateIndustryAsync(IndustryEditDto input)
        {
            //TODO:新增前的逻辑判断,是否允许新增

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

            entity = await _industryRepository.InsertAsync(entity);

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