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
|
Can I do something like Find<"TypeAsString">( instead of Find thanks gmd |
|
|
No you cant do this in .NET as the generic arguments need to be specified at compile time. What you will want to use IUnitOfWork.Find(Type, QueryExpression) so you can pass in the type argument directly, or if you want to pass in a Query object use IUnitOfWork.Find(Query) and then set the EntityType property on the query. If you actually need to find the Type at runtime via a string literal, you can use Type.GetType(string) to get a type reference.
|
|
|
Thanks Jeremy, sometimes I just miss Objective C , I am new to C# and WPF and have to get used to somebody breathing down my neck all the time ... the typed compiler that is :) That is the right pointer and I currently experiment with type templates to also get the Collections generic. I used getType() and reflection to actually transfer values from a Lightspeed generated property to an internal (own class) property and make some code as generic as possible because we have literally hundreds of different dialogue functions all doing much the same thing only the fields and some validations are different. I looked at property grid and some possible extension/customisation but decided to specify our own generic presentation concept. Thanks very much, you are doing real good work with your forum and answers and it was a major factor in the decision to purchase your products and we will need more licenses in the future :).. regards gmd |
|