This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var model = RuntimeTypeModel.Default; | |
| // Obtain all serializable types having no explicit proto contract | |
| var serializableTypes = Assembly.GetExecutingAssembly() | |
| .GetTypes() | |
| .Where(t => t.IsSerializable && !Attribute.IsDefined(t, typeof(ProtoContractAttribute))); | |
| foreach (var type in serializableTypes) | |
| { | |
| var metaType = model.Add(type, false); | |
| metaType.AsReferenceDefault = true; |