This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
How can I specify a different SQL Server Schema than dbo for the KeyTable? I have to add a KeyTable object to my database in a specified schema that relates to my application... |
|
|
Just create the table manually as required, the default create script for SQL Server is:
When executing commands against the KeyTable we use the default schema on the LightSpeedContext instance which your UnitOfWork was created from so just ensure that is using the same schema as you have used when creating your KeyTable.
|
|
|
I assumed it would be this - but where is the "Default Schema" property on the LightSpeedContext...? |
|
|
LightSpeedContext.Schema is what you need to set. You can do this from within a UnitOfWork by using UnitOfWork.Context.Schema
|
|
|
Oh... I was hoping this was in the Content - not the UOW... My problem is that I have a single factory method to create all Contexts - and then I have UOW's being created all over my app from the context created from that factory method. I was hoping it would be a Context property so I could just set it in that factory method. Can you suggest an easy way for me to set the default Schema for all UOW's created throughout my app without having to remember to set it every time I instantiate a UOW in my code? |
|
|
Ah but it is context property - just set the Schema property when initialising your context and it will then be in place for an UOW instances created after that.
|
|