WebApiContrib / WebApiContrib.Formatting.ProtoBuf

Web API formatter based on ProtoBuf
http://nuget.org/packages/WebApiContrib.Formatting.ProtoBuf
MIT License
30 stars 19 forks source link

RuntimeTypeModel exposed as public & lazy #1

Closed filipw closed 11 years ago

filipw commented 11 years ago

Changed RuntimeTypeModel to be public. It is common in ProtoBuf usage to precompile types, which was not possible with the previous solution. Now you can something like that from for example global config:

        ProtoBufFormatter.Model.Add(typeof(MyType),false);
        ProtoBufFormatter.Model.Compile();

Additionally made it Lazy so that the formatter can be added to formatters collection without much footprint. Also removed dependency on JSON.NET (not used in this project at all).