Beispiel #1
0
 // Static initializer to register generated cache loaders.
 // This will ensure they will be registered only once.
 static LookupCacheLoaders()
 {
     LookupCache.AddCacheLoader(new ProductReadListCacheLoader());
     LookupCache.AddCacheLoader(new ShipMethodReadListCacheLoader());
     LookupCache.AddCacheLoader(new SalesPersonReadListCacheLoader());
     LookupCache.AddCacheLoader(new SalesReasonReadListCacheLoader());
     LookupCache.AddCacheLoader(new SalesTerritoryReadListCacheLoader());
     LookupCache.AddCacheLoader(new SpecialOfferReadListCacheLoader());
 }
Beispiel #2
0
        /// <summary>
        /// Initializes Xomega Framework runtime environment.
        /// </summary>
        public static void Init()
        {
            // register generated Lookup Cache Loaders via the static initializer
            AdventureWorks.Services.LookupCacheLoaders.EnsureRegistered();

            // load enumerations from the generated Enumeration Data XML
            Assembly asm = typeof(AdventureWorks.Enumerations.Operators).Assembly;

            foreach (string resource in asm.GetManifestResourceNames())
            {
                if (resource.EndsWith(".enumerations.xml"))
                {
                    LookupCache.AddCacheLoader(new XmlLookupCacheLoader(asm.GetManifestResourceStream(resource)));
                    break;
                }
            }
        }