示例#1
0
        private static void DeleteSiteMenu(TenantCache tenantCache, List <long> siteIds)
        {
            var siteMenu = new SiteMenu();

            tenantCache.SiteMenu?.ForEach(data =>
                                          siteMenu.Add(data.Key, data.Value));
            siteMenu.RemoveAll((key, value) => siteIds.Contains(key));
            tenantCache.SiteMenu = siteMenu;
        }
示例#2
0
        private static void SetSiteMenu(Context context, TenantCache tenantCache, EnumerableRowCollection <DataRow> dataRows)
        {
            var siteMenu = new SiteMenu();

            tenantCache.SiteMenu?.ForEach(data =>
                                          siteMenu.Add(data.Key, data.Value));
            foreach (var dataRow in dataRows)
            {
                siteMenu.AddOrUpdate(
                    dataRow.Long("SiteId"),
                    new SiteMenuElement(
                        context: context,
                        siteId: dataRow.Long("SiteId"),
                        referenceType: dataRow.String("ReferenceType"),
                        parentId: dataRow.Long("ParentId"),
                        title: dataRow.String("Title")));
            }
            tenantCache.SiteMenu = siteMenu;
        }