Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 408
Interface base Code generation
chaowlert edited this page Jan 24, 2021
·
1 revision
Annotate your interface with [Mapper] in order for tool to pickup for generation.
This is example interface.
[Mapper]publicinterfaceIProductMapper{ProductDTOMap(Productcustomer);}You can add multiple members as you want. All member names are flexible, but signature must be in following patterns:
[Mapper]publicinterfaceICustomerMapper{//for queryableExpression<Func<Customer,CustomerDTO>>ProjectToDto{get;}//map from POCO to DTOCustomerDTOMapToDto(Customercustomer);//map to existing objectCustomerMapToExisting(CustomerDTOdto,Customercustomer);}If you have configuration, it must be in IRegister
publicclassMyRegister:IRegister{publicvoidRegister(TypeAdapterConfigconfig){config.NewConfig<TSource,TDestination>();}}