GreanTech / AtomEventStore

A server-less .NET Event Store based on the Atom syndication format
MIT License
117 stars 14 forks source link

Convention-based type resolver for XML serializer #93

Closed ploeh closed 10 years ago

ploeh commented 10 years ago

If you want to use the XmlContentSerializer, you must supply an appropriate ITypeResolver instance. Current options are:

It would be nice with an associated ITypeResolver implementation that can scan an assembly and find all types annotated with [XmlRoot] attributes, and pull the associated local and namespace names out of them.

Perhaps it should be an internal class, with a static factory method defined on XmlContentSerializer, in order to signal that this ITypeResolver only makes sense used together with XmlContentSerializer. Another option is to make it a nested public class under XmlContentSerializer.

In any case, it would need an Assembly object as input. It would then scan that Assembly for all matching classes.