예제 #1
0
        public async Task Create(CreateElementDto input)
        {
            var @element = input.MapTo <Element>();

            @element = Element.Create(AbpSession.GetTenantId(), input.Name, input.Length, input.Width, input.Category, input.Path);
            await _elementRepository.InsertAsync(@element);
        }
예제 #2
0
        public string AddElement(CreateElementDto input)
        {
            var item = _elementRepository.GetAll().Where(x => x.IsDeleted == false && x.Name == input.Name).Count();

            if (item > 0)
            {
                return("该名称已经存在");
            }

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

            _elementRepository.InsertAsync(entity);
            return("添加成功!");
        }