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
|
Hello all, first of all: Thanks for the great product. Could you please provide me with an C#-code-example applying the INamingStrategy-Interface? I need a custom database-model-mapping. The API does not help me. Thanks for your answer, Henning |
|
|
I've attached an example implementation from our test suite. In this example, we assume that the database designer has used different names for the 'special columns' (e.g. the creation timestamp), has prefixed table names with 'tbl_' and has adopted the convention that the ID column will be called e.g. CustomerId, ProductId etc. rather than just Id. Note that INamingStrategy is generally meant to reflect a predictable and consistent -- but different from the LightSpeed default -- set of conventions for naming. If you require a completely custom mapping, use TableAttribute (or the Table Name setting in the designer) to map entity types individually to tables. |
|
|
I am having trouble downloading the CustomNamingStrategy.cs file in this post. Could you re-post it? I have a need to implement/replace the naming strategy on a current context. Thanks, -Joe
|
|
|
Attached -- let us know if you still can't download it. |
|
|
Hmm, something seems busted. I'll get someone to look at it. |
|
|
Okay, seems we've got an issue with attachments with the .cs file extension. Here's the file again -- rename back to CustomNamingStrategy.cs after downloading. |
|
|
Thanks... very helpful! |
|