/// <summary>
        ///     Returns a ObjectContext type the satisfies the provided requirements. If no
        ///     such element exists the provided factory method is used to create one.
        /// </summary>
        /// <param name="entityConnectionString">
        ///     The entity connection string that identifies the database instance.
        /// </param>
        /// <param name="effortConnectionString">
        ///     The effort connection string that containes the database configuration.
        /// </param>
        /// <param name="objectContextType">
        ///     The base type that result type is derived from.
        /// </param>
        /// <param name="objectContextTypeFactoryMethod">
        ///     The factory method that instatiates the desired ObjectContext type.
        /// </param>
        /// <returns></returns>
        public static Type GetObjectContextType(
            string entityConnectionString,
            string effortConnectionString,
            Type objectContextType,
            Func <Type> objectContextTypeFactoryMethod)
        {
            ObjectContextTypeKey key =
                new ObjectContextTypeKey(
                    entityConnectionString,
                    effortConnectionString,
                    objectContextType);

            return(store.Get(key, objectContextTypeFactoryMethod));
        }
Ejemplo n.º 2
0
 /// <summary>
 ///     Returns a <see cref="T:CachingTableDataLoader"/> object that satisfies the
 ///     specified arguments. If no such element exists the provided factory method is
 ///     used to create one.
 /// </summary>
 /// <param name="key">
 ///     Identifies the caching data loader.
 /// </param>
 /// <param name="factoryMethod">
 ///     The factory method that instatiates the desired
 ///     <see cref="T:CachingTableDataLoader"/> object.
 /// </param>
 /// <returns>
 ///     The <see cref="T:CachingTableDataLoader"/> object.
 /// </returns>
 public static CachingTableDataLoader GetCachedData(
     CachingTableDataLoaderKey key,
     Func <CachingTableDataLoader> factoryMethod)
 {
     return(store.Get(key, factoryMethod));
 }
 /// <summary>
 ///     Returns a <see cref="DbContainer"/> object identified by the specified instance
 ///     identifier. If no such element exist, the specified factory method is used to
 ///     create one.
 /// </summary>
 /// <param name="instanceId"> The instance id. </param>
 /// <param name="databaseFactoryMethod"> The database factory method. </param>
 /// <returns> The <see cref="DbContainer"/> object. </returns>
 public static DbContainer GetDbContainer(
     string instanceId,
     Func <DbContainer> databaseFactoryMethod)
 {
     return(store.Get(instanceId, databaseFactoryMethod));
 }
Ejemplo n.º 4
0
 /// <summary>
 ///     Returns a <see cref="DbSchema"/> object that is associated to the specified
 ///     DbSchemaKey.
 /// </summary>
 /// <param name="schemaKey"> The DbSchemaKey object. </param>
 /// <returns> The DbSchema object. </returns>
 public static DbSchema GetDbSchema(DbSchemaKey schemaKey)
 {
     return(store.Get(schemaKey));
 }
Ejemplo n.º 5
0
 /// <summary>
 ///     Returns a <see cref="MetadataWorkspace"/> object that derived from the
 ///     specified metadata in order to be compatible with the Effort provider. If no
 ///     such element exist, the specified factory method is used to create one.
 /// </summary>
 /// <param name="metadata">
 ///     References the metadata resource.
 /// </param>
 /// <param name="workspaceFactoryMethod">
 ///     The factory method that instantiates the desired element.
 /// </param>
 /// <returns>
 ///     The MetadataWorkspace object.
 /// </returns>
 public static MetadataWorkspace GetMetadataWorkspace(
     string metadata,
     Func <string, MetadataWorkspace> workspaceFactoryMethod)
 {
     return(store.Get(metadata, () => workspaceFactoryMethod(metadata)));
 }