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
|
Hi, I'm quite new to LightSpeed as in trying out the express version for 15 minutes. I already found a big problem where LS changes my column names (casing) and removes the underscores. Our database has more than 200 tables with thousands of columns in total. You can imagine I can't go through all columnnames and change them back as they are in the database. For the moment we're using XPO, EF and Typed Datasets mixed and we're seriously looking for 1 ORM instead of 3. If you could fix this problem of name changing, it would be a serious plus towards LS. And yes, we are talking about buying it 'immediately'. I still have to test LinqInstantFeedBackSource (from DevExpress) with LS though :). Any pointers here would help too. Greetings, Sigurd |
|
|
LightSpeed creates class and property names to follow .NET naming conventions -- that is, PascalCased without underscores. The classes and properties are still mapped to the original table and column names as specified in the database, as you can verify by checking the Table Name and Column Name settings in the Properties window. (See the attached screenshot.) So you don't need to change the .NET names to match the database -- that is handled in the mapping. (We did have some bugs in this at one point, where the Table Name and Column Name mappings were not set up if the only difference was the underscore. Grab the latest nightly build from the Downloads page if you suspect you're running into this.) Now if you really really want your .NET class and property names to exactly follow your database names instead of the normal CLR convention, you can force this, but it's a deliberately hidden feature, and you will again need a recent nightly build. See http://www.mindscapehq.com/forums/thread/318168 for information about this. But we'd encourage you to let your code use idiomatic C#/VB naming conventions which will be familiar to all .NET programmers, and let the ORM take care of the mapping to your database's naming convention. |
|
|
Hi, I've seen that post and it's a bit dazzling to me. Since I'm very, very new to LS, I have troubles understanding it all. Perhaps you can provide a sample project which does this? For us it is very important that the properties have the same name as the database fields. We have a clear name convention for our column names. It also helps to seperate the 'database' properties from the others. E.g the 'Name' field of our contact table is 'CONTName' and not 'ContName'. In views this is very handy where we combine many tables. This reminds me of another, smaller issue. The 'Id' property should be 'CONTID' in this example, but I guess this is not possible in LS. To end with a positive note, I just love the GuidComb! I had to manually implement this in all other frameworks we used so far :). Greetings, Sigurd |
|
|
Yes, it's a deliberately obscured setting which means it's not beginner friendly! I've attached a couple of sample projects to get you started. LightSpeedDesignTimeHelpers implements the 'preserve underscores' strategy. I've included the source code for this in case you need to extend or tweak it, but you probably shouldn't need to. LightSpeedUnderscoreyModel is a data model which uses the 'preserve underscores' strategy to avoid CLRifying the names as you request. I've dragged an example entity onto the model surface to show it working, though of course you'll want to delete that. You should be able to drag your own entities into Model.lsmodel and have the underscores preserved. Note that Model.lsmodel refers to the compiled LightSpeedDesignTimeHelpers assembly in the Lib directory, so if you copy it elsewhere, you will need to copy the design-time assembly with it. Let me know if you need more info or any help to get it running. By the way, our forums editor interprets underscores as italics; if you want to show a name with an underscore in it, you can use the backtick key or the 101010 button to format that name as code e.g. |
|
|
Hi, This seems to work very well. Had to do a little digging to add the design time assembly in my project :). It still removes the underscores in view names, but I can live with that. We have only 10 views or so. Thank you very much for the quick reply and solution. I really start to like your product and service! Greetings, Sigurd |
|