Esempio n. 1
0
        protected PostStoreEntityType[] ToEntityTypes(GenericPostStoreEntityType entityType)
        {
            switch (entityType)
            {
            case GenericPostStoreEntityType.BoardPage:
                return(GenericEntityTypesMapping.BoardPage);

            case GenericPostStoreEntityType.Catalog:
                return(GenericEntityTypesMapping.Catalog);

            case GenericPostStoreEntityType.Thread:
                return(GenericEntityTypesMapping.Thread);

            case GenericPostStoreEntityType.Post:
                return(GenericEntityTypesMapping.Post);

            default:
                return(GenericEntityTypesMapping.Unknown);
            }
        }
Esempio n. 2
0
        private (ILink link, ILink parentLink, int sequenceId, string boardId, int?parentSequenceId) LoadEntityLinks(PostsTable table, GenericPostStoreEntityType genEntityType)
        {
            var   v = table.Views.LinkInfoView.Fetch();
            var   boardId = v.BoardId;
            var   seqId = v.SequenceNumber;
            var   parentSeqId = v.ParentSequenceNumber;
            ILink link, parentLink;

            ConstructLinksForBasicLoad(genEntityType, boardId, parentSeqId, seqId, out link, out parentLink);
            return(link, parentLink, seqId, boardId, parentSeqId);
        }
Esempio n. 3
0
        private void ConstructLinksForBasicLoad(GenericPostStoreEntityType genEntityType, string boardId,
                                                int?parentSeqId, int seqId, out ILink link, out ILink parentLink)
        {
            switch (genEntityType)
            {
            case GenericPostStoreEntityType.Post:
                link = new PostLink()
                {
                    Engine    = EngineId,
                    Board     = boardId,
                    OpPostNum = parentSeqId ?? 0,
                    PostNum   = seqId
                };
                parentLink = new ThreadLink()
                {
                    Engine    = EngineId,
                    Board     = boardId,
                    OpPostNum = parentSeqId ?? 0
                };
                break;

            case GenericPostStoreEntityType.Catalog:
                link = new CatalogLink()
                {
                    Engine   = EngineId,
                    Board    = boardId,
                    SortMode = (BoardCatalogSort)seqId
                };
                parentLink = new BoardLink()
                {
                    Engine = EngineId,
                    Board  = boardId
                };
                break;

            case GenericPostStoreEntityType.Thread:
                link = new ThreadLink()
                {
                    Engine    = EngineId,
                    Board     = boardId,
                    OpPostNum = seqId
                };
                parentLink = new BoardLink()
                {
                    Engine = EngineId,
                    Board  = boardId
                };
                break;

            case GenericPostStoreEntityType.BoardPage:
                link = new BoardPageLink()
                {
                    Engine = EngineId,
                    Board  = boardId,
                    Page   = seqId
                };
                parentLink = new RootLink()
                {
                    Engine = EngineId,
                };
                break;

            default:
                link       = null;
                parentLink = new RootLink()
                {
                    Engine = EngineId,
                };
                break;
            }
        }