-
Notifications
You must be signed in to change notification settings - Fork 331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ConstructUsing for generic types doesn't work #507
Comments
@omerercelik Which version of Mapster are you using? |
@andrerav I am using 7.3.0 |
@omerercelik You can set Full sample of this case. propably i found the source of this problem ) |
If Type is System.Type? then as far as I understand it cannot be created. This can only be obtained. typeof(), .Gettype() valid Generic definition possible must look like as typeof(PagedList<>), and mapping from this and mapping for this should be supported endofpage
|
How can I use contructusing method in generic classes? Or How can i skip this error when generic class have one more constructor?
|
Even if you bring it to a case that in theory should work. You get IQueryable from the conversion function and there will always be an error Instead of the data you need
|
@andrerav For some reason, RecordType is involved there again))) |
@omerercelik This working From This @andrerav I managed to separate the processing of interfaces without public setters from the processing of RecordTypes) But IQueryable now not supported
|
TypeAdapterConfig<PagedList<ExampleEntity>, PagedList<ExampleDto>>.ForType().ConstructUsing(dest => new PagedList<ExampleDto>(new List<ExampleDto>(), 1, 1));
= > its workTypeAdapterConfig<PagedList<Type>, PagedList<Type>>.ForType().ConstructUsing(dest => new PagedList<Type>(new List<Type>(), 1, 1));
it doesn't work and throw ExceptionException => System.InvalidOperationException : No default constructor for type 'PagedList`1', please use 'ConstructUsing' or 'MapWith'
pagedlist constructors;
The text was updated successfully, but these errors were encountered: