Exemplo n.º 1
0
        public async Task <IActionResult> AddStory([FromForm] AddStoryRequest request)
        {
            var response = await mediator.Send(request);

            logger.LogResponse($"User #{HttpContext.GetCurrentUserId()} added story #{response.Story?.Id}",
                               response.Error);

            return(this.CreateResponse(response));
        }
Exemplo n.º 2
0
        public bool AddStory(AddStoryRequest request)
        {
            var story = new Story()
            {
                Description = request.Description,
                Title       = request.Title
            };

            var result = _serviceProvider.GetService <IMediumRepository>().Create(story).Id;

            return(result != 0);
        }
Exemplo n.º 3
0
 public bool AddStory(AddStoryRequest request)
 {
     return(_serviceProvider.GetService <IMediumEngine>().AddStory(request));
 }