コード例 #1
0
 public PostController(PostContainer postcontainer, ReplyContainer replycontainer, ForumContainer forumcontainer, IPostUpdateContext update)
 {
     this.Container      = postcontainer;
     this.replyContainer = replycontainer;
     this.forumContainer = forumcontainer;
     this.postUpdate     = update;
 }
コード例 #2
0
        public Task <ReplyContainer> TryParseToDatabaseQuery(string[] words)
        {
            return(Task.Run(() =>
            {
                var container = new ReplyContainer();
                foreach (var word in words)
                {
                    var matcher = _entityMatcherProvider.TryGetEntityTypeByTag(word);
                    if (matcher != null)
                    {
                        if (matcher.GetEntityType == typeof(Product))
                        {
                            var commandresult = GetListOfProducts(matcher);
                            container
                            .DomainDataList
                            .AddRange(
                                commandresult
                                .Select(x => new DisplayedObject
                            {
                                DisplayInformation = x.ToString(),
                                ImageName = x.ImageName
                            }));
                        }

                        if (matcher.GetEntityType == typeof(Category))
                        {
                            var commandresult = GetListOfCategories(matcher);
                            container
                            .DomainDataList
                            .AddRange(
                                commandresult
                                .Select(x => new DisplayedObject
                            {
                                DisplayInformation = x.ToString(),
                                ImageName = x.ImageName
                            }));
                        }
                    }
                }

                return container;
            }));
        }
コード例 #3
0
 public ReplyController(ReplyContainer container)
 {
     this.replyContainer = container;
 }