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
|
I want to do filtering on in-memory lists based on the Full text indexed properties. However as GetSearchData() is protected I can't go this in a generic way without a lot of boilerplate code. Would you be able to promote Entity.GetSearchData() to public? Sean |
|
|
We'd prefer not to do this because in the general case GetSearchData is there to be overridden to customise what gets indexed, rather than to tell consumers what gets indexed. You can avoid the boilerplate code by creating an intermediate base class for your entities: public class SearchableEntity<TId> : Entity<TId> { We've added a 'creation policy' capability to the designer in LS4 so that you can automatically have new entities inherit from a specified base class -- see http://www.mindscapehq.com/documentation/lightspeed/Working-with-Models-in-the-Visual-Designer/Changing-the-Designer-Defaults for info. You will need to fix up existing entities but I think you can do those by selecting all of them and changing the base class, no need to do it individually on each one. |
|
|
That looks like it could work. Is there any way to use a base class from another assembly? |
|
|
You would have to specify it as an external class reference -- Explorer > right-click > Add External Class Reference, then enter the fully-qualified type name (and the identity type if your base class defines the identity type, e.g. MyBase : Entity<int>, or identity type Generic if your base class supports different identity types e.g. MyBase<TId> : Entity<TId> -- this is needed for database sync because we can't work it out at design time). Other than that little wrinkle it should work fine, but if you run into any problems, just let us know. |
|
|
That did it. Thanks |
|