当前位置: 首页>>代码示例>>C#>>正文


C# IList.ToCommaDelimitedString方法代码示例

本文整理汇总了C#中IList.ToCommaDelimitedString方法的典型用法代码示例。如果您正苦于以下问题:C# IList.ToCommaDelimitedString方法的具体用法?C# IList.ToCommaDelimitedString怎么用?C# IList.ToCommaDelimitedString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IList的用法示例。


在下文中一共展示了IList.ToCommaDelimitedString方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Archive_MovePagesTo

        public void Archive_MovePagesTo(IList<ulong> pageIdsToArchive, uint transactionId) {
            if(ArrayUtil.IsNullOrEmpty(pageIdsToArchive)) {
                return;
            }

            var pageIdsStr = pageIdsToArchive.ToCommaDelimitedString();
            Catalog.NewQuery(string.Format(@" /* Archive_MovePagesTo */
 	INSERT INTO archive (ar_namespace, ar_title, ar_text, ar_comment, ar_user, ar_timestamp, ar_minor_edit, ar_last_page_id, ar_old_id, ar_content_type, ar_language, ar_display_name, ar_transaction_id, ar_is_hidden, ar_meta, ar_revision) 
 		select page_namespace, page_title, old_text, old_comment, old_user, old_timestamp, old_minor_edit, old_page_id, old_id, old_content_type, old_language, old_display_name, ?TRANID, old_is_hidden, old_meta, old_revision
		from `old` o 
		join pages p
		on	o.old_page_id = p.page_id
		where p.page_id in ({0});

	INSERT INTO archive (ar_namespace, ar_title, ar_text, ar_comment, ar_user, ar_timestamp, ar_minor_edit, ar_last_page_id, ar_content_type, ar_language, ar_display_name, ar_transaction_id, ar_is_hidden, ar_meta, ar_revision) 
		select page_namespace, page_title, page_text, page_comment, page_user_id, page_timestamp, page_minor_edit, p.page_id, page_content_type, page_language, page_display_name, ?TRANID, page_is_hidden, page_meta, page_revision
		from `pages` p
		where page_is_redirect=0
        and p.page_id in ({0});

    delete from old
    where  old_page_id in ({0});

	delete from pages
	where page_id in ({0});", pageIdsStr))
                 .With("TRANID", transactionId)
                 .Execute();
        }
开发者ID:heran,项目名称:DekiWiki,代码行数:28,代码来源:ArchiveDA.cs

示例2: Archive_Delete

        public void Archive_Delete(IList<uint> archiveIds) {
            if (ArrayUtil.IsNullOrEmpty(archiveIds)) {
                return;
            }

            var archiveIdsString = archiveIds.ToCommaDelimitedString();
            Catalog.NewQuery(string.Format(@" /* Archive_Delete */
delete from archive
where ar_id in ({0});",
            archiveIdsString)).Execute();
        }
开发者ID:heran,项目名称:DekiWiki,代码行数:11,代码来源:ArchiveDA.cs

示例3: ResourceMapping_GetByResourceIds

        public IList<ResourceIdMapping> ResourceMapping_GetByResourceIds(IList<uint> resourceIds) {
            List<ResourceIdMapping> ret = new List<ResourceIdMapping>();
            if(resourceIds.Count == 0) {
                return ret;
            }
            string query = @" /* ResourceMapping_GetByResourceIds */
select resource_id, 'file' as entity_type, file_id as entity_id
from resourcefilemap
where resource_id in ({0})
";
            Catalog.NewQuery(string.Format(query, resourceIds.ToCommaDelimitedString()))
            .Execute(dr => ret.AddRange(ResourceMapping_Populate(dr)));
            return ret;
        }
开发者ID:heran,项目名称:DekiWiki,代码行数:14,代码来源:ResourceMapDA.cs

示例4: GroupMembers_UpdateUsersInGroup

        public void GroupMembers_UpdateUsersInGroup(uint groupid, IList<uint> userIds, DateTime timestamp) {
            string userIdInClause = userIds.ToCommaDelimitedString();
            string deleteQuery = "delete from user_groups where group_id = ?GROUPID";
            StringBuilder insertQuery = new StringBuilder();
            if (userIds.Count > 0) {
                deleteQuery = string.Format("{0} and user_id not in ({1})", deleteQuery, userIdInClause);
                insertQuery.Append("insert ignore into user_groups (user_id, group_id, last_edit) values ");
                for (int i = 0; i < userIds.Count; i++) {
                    insertQuery.AppendFormat("{0}({1}, ?GROUPID, ?TIMESTAMP)", i > 0 ? "," : "", userIds[i]);
                }
            }

            Catalog.NewQuery(string.Format(@" /* GroupMembers_UpdateUsersInGroup */
{0};
{1};", deleteQuery, insertQuery))
            .With("GROUPID", groupid)
            .With("TIMESTAMP", timestamp)
            .Execute();
        }
开发者ID:heran,项目名称:DekiWiki,代码行数:19,代码来源:GroupDA.cs

示例5: Pages_GetContents

        public IList<PageTextContainer> Pages_GetContents(IList<ulong> pageids) {
            List<PageTextContainer> ret = new List<PageTextContainer>();
            if(ArrayUtil.IsNullOrEmpty(pageids)) {
                return ret;
            }

            string pageIdsText = pageids.ToCommaDelimitedString();
            Catalog.NewQuery(
string.Format(
@"/* Pages_GetContents */
SELECT p.page_id, p.page_timestamp, p.page_text
FROM pages p
WHERE p.page_id in ({0})",
pageIdsText))
                .Execute(delegate(IDataReader dr) {
                while(dr.Read()) {
                    PageTextContainer ptc = new PageTextContainer(
                        DbUtils.Convert.To<ulong>(dr["page_id"], 0),
                        DbUtils.Convert.To<string>(dr["page_text"], string.Empty),
                        DbUtils.ToDateTime(dr["page_timestamp"].ToString())
                    );

                    ret.Add(ptc);
                }
            });
            return ret;
        }
开发者ID:heran,项目名称:DekiWiki,代码行数:27,代码来源:PageDA.cs

示例6: Pages_GetRedirects

        public Dictionary<ulong, IList<PageBE>> Pages_GetRedirects(IList<ulong> pageIds) {
            Dictionary<ulong, IList<PageBE>> ret = new Dictionary<ulong, IList<PageBE>>();
            if(pageIds == null || pageIds.Count == 0) {
                return ret;
            }
            string pageIdsText = pageIds.ToCommaDelimitedString();
            string query = string.Format(@" /* PageDA::Pages_GetRedirects */
SELECT l_to, {0}
FROM pages p
JOIN links
	ON p.page_id = l_from
WHERE p.page_is_redirect=1 
AND l_to IN({1});
", PAGEFIELDS, pageIdsText);

            Catalog.NewQuery(query)
                .Execute(delegate(IDataReader dr) {
                while(dr.Read()) {
                    PageBE p = Pages_PopulatePage(dr);
                    ulong to = dr.Read<ulong>("l_to");
                    IList<PageBE> redirectsForId = null;
                    if(!ret.TryGetValue(to, out redirectsForId)) {
                        ret[to] = redirectsForId = new List<PageBE>();
                    }
                    redirectsForId.Add(p);
                }
            });
            return ret;
        }
开发者ID:heran,项目名称:DekiWiki,代码行数:29,代码来源:PageDA.cs

示例7: Groups_GetByIds

 public IList<GroupBE> Groups_GetByIds(IList<uint> groupIds) {
     if(groupIds.Count == 0) {
         return new List<GroupBE>();
     }
     return Groups_GetInternal(string.Format("where groups.group_id in ({0})", groupIds.ToCommaDelimitedString()), "Groups_GetByIds");
 }
开发者ID:heran,项目名称:DekiWiki,代码行数:6,代码来源:GroupDA.cs

示例8: Archive_GetRevisionsByPageIds

        public Dictionary<ulong, IList<ArchiveBE>> Archive_GetRevisionsByPageIds(IList<ulong> pageIds) {
            Dictionary<ulong, IList<ArchiveBE>> archivesRevsByPageId = new Dictionary<ulong, IList<ArchiveBE>>();
            string pageidsString = pageIds.ToCommaDelimitedString();
            Catalog.NewQuery(string.Format(@" /* Archive_GetRevisionsByPageIds */
select 	*
from	archive
where 	ar_last_page_id in ({0})
order by ar_last_page_id desc, ar_timestamp asc
", pageidsString)).Execute(delegate(IDataReader dr) {
                while (dr.Read()) {

                    IList<ArchiveBE> revisions = null;
                    ArchiveBE p = Archive_Populate(dr);
                    archivesRevsByPageId.TryGetValue(p.LastPageId, out revisions);
                    if (revisions == null)
                        revisions = new List<ArchiveBE>();

                    revisions.Add(p);
                    archivesRevsByPageId[p.LastPageId] = revisions;
                }
            });

            return archivesRevsByPageId;
        }
开发者ID:heran,项目名称:DekiWiki,代码行数:24,代码来源:ArchiveDA.cs

示例9: Resources_Delete

        public void Resources_Delete(IList<uint> resourceIds) {
            //TODO MaxM: Remove content as well

            if(resourceIds.Count == 0) {
                return;
            }
            string resourceIdsText = resourceIds.ToCommaDelimitedString();

            Catalog.NewQuery(string.Format(@" /* Resources_Delete */
delete from resources where res_id in ({0});
delete from resourcerevs where resrev_res_id in ({0});", resourceIdsText))
            .Execute();
        }
开发者ID:heran,项目名称:DekiWiki,代码行数:13,代码来源:ResourceDA.cs

示例10: TagMapping_Delete

        public void TagMapping_Delete(ulong pageId, IList<uint> tagids) {

            // deletes the specified page to tag mappings and removes the tag if it is no longer used
            if(0 < tagids.Count) {
                string tagIdsText = tagids.ToCommaDelimitedString();
                Catalog.NewQuery(String.Format(@" /* Tags_Delete */
DELETE FROM tag_map
WHERE tagmap_page_id = ?PAGEID AND tagmap_tag_id in ({0});

DELETE FROM tags
USING tags
LEFT JOIN tag_map tm ON tags.tag_id = tm.tagmap_tag_id
WHERE tag_id in ({0}) AND tm.tagmap_id IS NULL;", tagIdsText))
                            .With("PAGEID", pageId)
                            .Execute();
            }
        }
开发者ID:heran,项目名称:DekiWiki,代码行数:17,代码来源:TagDA.cs

示例11: Links_MoveInboundToBrokenLinks

        public void Links_MoveInboundToBrokenLinks(IList<ulong> deletedPageIds) {
            if (ArrayUtil.IsNullOrEmpty(deletedPageIds)) {
                return;
            }
            string pageIdsString = deletedPageIds.ToCommaDelimitedString();
            string query = String.Format(@" /* Links_MoveLinksToBrokenLinks */
insert ignore into brokenlinks(bl_from, bl_to)
	select t.l_from, p.page_title
	from pages p
	join (
		select l_from, l_to 
	        from links
        	where l_to in ({0})) t
	on p.page_id = t.l_to;

DELETE links FROM links
where 	l_from in ({0})
OR	l_to in ({0});", pageIdsString);

            Catalog.NewQuery(query)
                   .Execute();
        }
开发者ID:heran,项目名称:DekiWiki,代码行数:22,代码来源:LinksDA.cs


注:本文中的IList.ToCommaDelimitedString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。