Ejemplo n.º 1
0
        /// <summary>
        /// 编辑Locations
        /// </summary>
        //[AbpAuthorize(LocationsPermissions.Edit)]
        protected virtual async Task Update(LocationsEditDto input)
        {
            //TODO:更新前的逻辑判断,是否允许更新

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

            input.MapTo(entity);

            // ObjectMapper.Map(input, entity);
            await _entityRepository.UpdateAsync(entity);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 新增Locations
        /// </summary>
        //[AbpAuthorize(LocationsPermissions.Create)]
        protected virtual async Task <LocationsEditDto> Create(LocationsEditDto input)
        {
            //TODO:新增前的逻辑判断,是否允许新增

            // var entity = ObjectMapper.Map <Locations>(input);
            var entity = input.MapTo <Locations>();


            entity = await _entityRepository.InsertAsync(entity);

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