Using LLBLGen Pro Version 3.1 Final (March 12th, 2012)
Using Template: Adapter
Target Platform: .NET 2.0
SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll File version 3.1.12.0806
I try to execute a SP :
public static InvoicesTypedView SP_GetInvoices(int amount)
{
InvoicesTypedView result = new InvoicesTypedView ();
var query = RetrievalProcedures.GetQueryFor InvoicesTypedView (amount );
using (var daa = DataSourceHelper.GetDataAccessAdapter())
{
daa.FetchTypedView(result, query);
}
return result;
}
When I monitor (IRetrievalQuery) ‘query’ the referenced catalog is ‘tenant’.
In the dataAccessAdapter I use catelog overwrites.
public partial class DataAccessAdapter : Data.DatabaseSpecific.DataAccessAdapter
{
private const string TENANT_CATALOG_NAME_TO_USE_SETTING_KEY = "DefaultCatalogNameToUse";
private const string MASTER_CATALOG_NAME_TO_USE_SETTING_KEY = "MasterCatalogNameToUse";
private const string TENANT_DATABASE_CATALOG_NAME = "Tenant";
private const string MASTER_DATABASE_CATALOG_NAME = "Master";
public DataAccessAdapter() : base() {
this.CatalogNameUsageSetting = CatalogNameUsage.Default;
this.CatalogNameOverwrites = new CatalogNameOverwriteHashtable(CatalogNameUsage.Default);
this.CatalogNameOverwrites.Add(TENANT_DATABASE_CATALOG_NAME, System.Configuration.ConfigurationManager.AppSettings[TENANT_CATALOG_NAME_TO_USE_SETTING_KEY]);
this.CatalogNameOverwrites.Add(MASTER_DATABASE_CATALOG_NAME, System.Configuration.ConfigurationManager.AppSettings[MASTER_CATALOG_NAME_TO_USE_SETTING_KEY]);
}
}
I've read the thread http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=20590 and expected that the catalogoverwrites should also work on sp's.
Why is the catalogname not rewritten for StoredProcedures? I use the same DataAccessAdapter for fetching other entities, where the catalogname gets rewritten.