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; } } }
public StoriesController(IStoryService storyService, IReadStoryService readStoryService, IUserService userService) { _storyService = storyService; _readStoryService = readStoryService; _userService = userService; }