Thursday, February 09, 2012 Register    Login
Instructions

In order to add new threads or reply to existing posts, you have to be logged-in. If you are not registered yet, you need to register first, and then login with your personal credentials.

   

CslaFactory Forums
HomeHomeSupportSupportCslaFactory CTPCslaFactory CTPDifferent db ProvidersDifferent db Providers
Previous
 
Next
New Post
5/13/2008 6:52 PM
 
First of all, you have done a great job here. I have tried creating some code with your CslaFactory and it will be a real time-saver!! As far as I can see, there are a few things to iron out, but this looks like exactly what I have been wanting for my prijects for a long time! Now, I know you have said somewhere here that we can write our own database providers, but I can't figure out how to do that. Will you have documentation for that? I know there are probably a lot of people out there that use many other types of databases instead of just SQL Server. I need to write code for PostgreSQL, Oracle, and MySQL. At the very least, we need to be able to map C# types to DB types other than just SQL Server... Thanks again for your efforts on this product!!! Kim Friesen
 
New Post
5/13/2008 10:19 PM
 

Hi Kim,

you can find the text templates that are used to generate the tables.sql and storedprocedures.sql files in the TextTemplates directory under the CslaFactory installation directory. The templates dealing with database files all start with a DB-prefix. For example, DBTables.tt, DBStoredProcedureList.tt and so on. There is currently no proper documentation, so I think it might be a good idea to blog about it or open a thread so we can discuss some aspects of customizing the CslaFactory.

With the current release (CTP) it is not possible to map C# types to DB types other than SQL Server, because the provider model wasn't finished on time. Our current development version already uses the provider model to map types during the generation process.
If you want to change the mapping (for using a different database or even using non-standard types in your model), you need to implement a specific interface (IPropertyConversionProvider). There is a GetDatabaseType(PropertyType propertyType)-method, for example, that returns the string representation for the database type of given BusinessObject's property. Having implemented this interface, you will be able to introduce your conversion provider-.dll by extending a configuration file. The generation host will discover it and use your provider on generation.

-Marcel

 
Previous
 
Next
HomeHomeSupportSupportCslaFactory CTPCslaFactory CTPDifferent db ProvidersDifferent db Providers


   

UsersOnline
Membership Membership:
Latest New User Latest: jerrytrucks
Past 24 Hours Past 24 Hours: 0
Prev. 24 Hours Prev. 24 Hours: 1
User Count Overall: 1588

People Online People Online:
Visitors Visitors: 2
Members Members: 0
Total Total: 2

Online Now Online Now: