Esempio n. 1
0
        private async Task <Region> CreateRegion(string name, long?parentId = null)
        {
            var region = new Region
            {
                Name     = name,
                ParentId = parentId
            };
            await _generalRegionTreeManager.CreateAsync(region);

            return(region);
        }
Esempio n. 2
0
        public async Task <MenuDto> CreateOrUpdateMenuForOutput(MenuDto input)
        {
            if (input.Id.HasValue)
            {
                var menu = await _menuRepository.GetAsync(input.Id.Value);

                ObjectMapper.Map(input, menu);
                await _menuTreeManager.UpdateAsync(menu);

                return(ObjectMapper.Map <MenuDto>(menu));
            }
            else
            {
                var menu = ObjectMapper.Map <Menu>(input);
                await _menuTreeManager.CreateAsync(menu);

                await CurrentUnitOfWork.SaveChangesAsync();

                return(ObjectMapper.Map <MenuDto>(menu));
            }
        }
 public async Task AddAsync(Warehouse warehouse)
 {
     await _generalWarehouseTreeManager.CreateAsync(warehouse);
 }