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
|
while we're asking for features - and i'm putting off other stuff i need to do... would be fantastic to have option to tell the designer about a custom naming strategy. there's a heck of a lot of noise with the designer telling me: foreach entity remove column DeletedOnUtc remove column CreatedOnUtc remove column UpdatedOnUtc add column DeletedOn add column CreatedOn add column UpdatedOn
maybe if i could tell the designer of the naming strategy i'm using then it could ignore all these erroneous changes... this would also make me less likely to ignore the designer model/db sync and less likely to break the model/db mappings. :)
|
|
|
Your wish is our command. Except when it comes to nested value objects, of course. Beginning with the 21 August nightly, there'll be a secret option in the designer to inject your own naming strategy into the designer import and sync processes. It's pretty primitive and not very nice to work with, which is why I'm keeping it secret for now: we'll look at improving it if it proves useful. What you'll need to do is: * Create a new solution. You'll need to do this because we're going to be building a design-time class, and when we start using that class, it's going to lock the assembly, so you don't want to have the class in your main model solution. * In the new solution, create a class library project. Create a class which implements IDesignTimeNamingStrategy. This interface is defined in Mindscape.LightSpeed.Generator.Integration.Dsl.Mapping.dll, which you can find in the Tools/Designer directory. You'll be interested in implementing the GetPropertyName method (to strip Utc off the database column names so they match the magic LightSpeed field names) and the GetSpecialColumnName method (to add Utc to the default column names). Note GetPropertyName is called for ALL properties, not just special ones, so be sure to check before stripping the suffix! For GetEntityName just return the table name (we'll take care of singularising it) and for UseClrNamingConventions just return true. * Build the design-time project. * Now go back to your main solution. * Open your model in a text editor. To the <model> node, add the attribute designTimeNamingStrategyType="qualified_class_name". The class name needs to be namespace-qualified, but not assembly-qualified. Save and close the text editor. * Open your model in the designer. Go into the LightSpeed Model Explorer, right-click the Model node and choose Add Design Time Assembly. Enter the full path to the assembly you just built. This will lock the assembly. If you need to make changes to the design-time assembly, you'll need to close the Visual Studio instance containing your main solution to do so. * Save your changes. Now when you drag on a table containing, say, CreatedOnUtc this will be recognised as Track Create Time. And when you sync to a table containing a CreatedOnUtc column it will match the Track Create Time setting instead of trying to replace it with a CreatedOn column. Enjoy! |
|
|
just so you know - nightly build 6/9/10 has fixed this one too... all good. :D cheers! |
|