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
|
Is there a base class or default implementation of the INamingStrategy interface? I'd like to override just the "GetTableName()" method in the INamingStrategy interface without having to implement all members of the interface. Or, is there somewhere I can find out what the default implementation is for those methods, so I can just perform the default behavior in the methods I don't intend to change from the defaults? |
|
|
Hmm...I found "DefaultNamingStrategy" but it's a sealed class :( Guess I can create my own "CustomNamingStrategy" class that has a reference to the DefaultNamingStrategy and just forward all method calls to the default. More typing than I was hoping, though ;) |
|
|
There is a default implementation, cunningly named DefaultNamingStrategy. Unfortunately, it's sealed, so you can't override it. Fortunately, when LightSpeed calls your naming strategy, it already tells you what to do if you want the default behaviour, by passing in a defaultName argument. So the implementation of DefaultNamingStrategy is just: return defaultName; for every method. So just do that in all your other INamingStrategy methods and you'll be good to go. |
|
|
ah, ok. so no need to hold a reference to the DefaultNamingStrategy, I can just return the incoming "defaultName" parameter. very good. |
|