Exemplo n.º 1
0
        public async Task <string> PostReditPosts(List <RedditPostModel> postsList)
        {
            string signature = Request.Headers["Flamingo-Signature"];

            if (string.IsNullOrWhiteSpace(signature) || !signature.Equals(""))
            {
                return("you naughty boy stop trying to add stuff");
            }
            if (!_postsManager.IsPostListValid(postsList))
            {
                return("Invalid posts found");
            }

            try
            {
                return(await _postsManager.AddPostsAsync(postsList));
            }
            catch (Exception ex)
            {
                _logger.LogError("error adding posts", ex);
                return(ex.Message);
            }
        }