Hi,

reading trough all the posts I still do not get this to work :(

I want to call methods (properties) on System.Data.Linq.EntityRef<T>.

I imported the type , and I also succeeded to create a generic
TypeReference (using the extension method in CecilTests).

First question, do I need to IMPORT any TypeReference  for each
specific type ? Ie. if I have EntityRef<Customer> EntityRef<Order>
etc, do I need to import them all and if so can I check if they
already are imported or do I need to maintain my own cache for this ?

 But no the step I do not get to run, how to get now the method on the
generic type ? I tried to create an own MethodReference, ans
surprisingly it opens in ILDASM, however PEVERIFY and reflector crash
with unresolved token.

Looking into how it SHOULD look ILDASM shows me:

call       instance void valuetype
[System.Data.Linq]System.Data.Linq.EntityRef`1<class
ERP.Customer>::set_Entity(!0)

Instead my code results in:

call       instance void valuetype
[System.Data.Linq]System.Data.Linq.EntityRef`1<class
ERP.Customer>::set_Entity(ERP.Customer)

I tried to import both, the created generic type reference and the
method reference. Still unknown token and wrong type showing in ildasm
as the parameter.

Question for the methods is the same, do I need to import each one for
each generic parameter ? If so why, if the method belongs to the
generic INSTANCE, than the generic parameter type is known, so there
should be no need to create and import multiple methods.

What am I doing wrong ?

Joe

-- 
--
mono-cecil

Reply via email to