You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by Brandejs February 17, 2025
Hello,
First thanks for this project, it is really useful.
I am curious if it is possible to use an existing GridifyMapper and apply it to a "complex object". For example, I have an object Address. And I want to allow filtering only over some properties. The object is used in multiple entities, so I would like to restrict the given property on all entities. Similar to AutoMapper, where a DTO can be embedded and the correct map is used for it.
publicclassAddress{publicstringCity{get;set;}publicstringCountry{get;set;}publicstringSecret{get;set;}}publicclassUser{publicstringEmail{get;set;}publicAddressAddress{get;set;}// .... }publicclassCompany{publicstringName{get;set;}publicAddressAddress{get;set;}// .... }publicclassAddressGridifyMapper:GridifyMapper<Address>{publicAddressGridifyMapper(){AddMap("City", q =>q.City);AddMap("Country", q =>q.Country);// This field should not be allowed to filter// RemoveMap(nameof(Address.Secret))}}publicclassUserGridifyMapper:GridifyMapper<User>{publicUserGridifyMapper(){AddMap("Email", q =>q.Email);// Reuse Mapper from AddressGridifyMapperAddMap("Address", q =>q.Address);}}publicclassCompanyGridifyMapper:GridifyMapper<Company>{publicCompanyGridifyMapper(){AddMap("CompanyName", q =>q.Name);// Reuse Mapper from AddressGridifyMapperAddMap("Address", q =>q.Address);}}
```</div>
The text was updated successfully, but these errors were encountered:
Discussed in #251
Originally posted by Brandejs February 17, 2025
Hello,
First thanks for this project, it is really useful.
I am curious if it is possible to use an existing GridifyMapper and apply it to a "complex object". For example, I have an object Address. And I want to allow filtering only over some properties. The object is used in multiple entities, so I would like to restrict the given property on all entities. Similar to AutoMapper, where a DTO can be embedded and the correct map is used for it.
The text was updated successfully, but these errors were encountered: