Пример #1
0
        public async Task <PortfolioModel> Create(PortfolioModel model)
        {
            var entity = _mapper.Map <Portfolio>(model);

            entity.OwnerId = _currentUserScope.UserId;

            await _portfolioRepository.Insert(entity);

            var result = _mapper.Map <PortfolioModel>(entity);

            result.Positions = await _positionService.CreatePositions(entity.Id, model.Positions);

            return(result);
        }