Esempio n. 1
0
        public Proxy(IReadStoryService readStory, IUnitOfWork unitOfWork, IMapper mapper, IHttpContextAccessor httpContextAccessor)
        {
            _readStory = readStory;
            _story     = new Writer(new StoryFactory(unitOfWork, mapper, httpContextAccessor));

            _unitOfWork = unitOfWork;
            _mapper     = mapper;

            var context = httpContextAccessor.HttpContext;

            if (context?.User != null)
            {
                try
                {
                    _userId = context.User.GetUserId();
                }
                catch
                {
                    _userId = null;
                }
            }
        }
Esempio n. 2
0
 public StoriesController(IStoryService storyService, IReadStoryService readStoryService, IUserService userService)
 {
     _storyService     = storyService;
     _readStoryService = readStoryService;
     _userService      = userService;
 }