datacontractserializer - WCF Inheritance/Polymorphism and Serialization -
I have a class, ReportDef , which is a solid square that I have decorated [DataContract] and [DataMember] features as required, in the ReportDef assembly A1 with my service program , IReportService . I have another class again, UiReportDef , which meets ReportDef and is in the assembly A2 . UiReportDef does not have any additional state that cares about the service
I want to implement my service with an example of UiReportDef Any way to do this (without the need to manually create ReportDef example UiReportDef ) about the service without A2 ? I know about the known type . I do not want the A2 reference.
Edit: Here are some references that can make my question easier to understand. My service program implies IReportService which defines a method, RunReport (ReportDef report) . ReportDef is decorated with the DataContract attribute, and in it the personal members are decorated with DataMember . UiReportDef is in an assembly depending on UI-related assemblies, etc. I did not design the existing class hierarchy I have to pass ReportDefs and UiReportDefs (as ReportDefs ) for the new service, since reportDef is solid, I would expect the treatment of the serializer in the form of UiReportDefs as the ReportDefs in the absence of any other information.
I could not understand the question for you.
But I think that I understand the part of it, do you want to have a reference to solve an object in an assembly?
If so, you can not do it until you are ready to complete the entire reflection and it is called "object"
doing this is a common There is a way and in my last reply it was trying to explain that you should use an interface that can be referred to by both client / server.
This is a common thing
Or as your comment shows on your question, you can use the DTO object.
Comments
Post a Comment