//----------------------------------------------------------------------- // // Copyright (c) Outercurve Foundation. All rights reserved. // //----------------------------------------------------------------------- namespace DotNetOpenAuth.Messaging { using System; using Validation; /// /// A serializer for -derived types /// /// The DataBag-derived type that is to be serialized/deserialized. internal interface IDataBagFormatter where T : DataBag { /// /// Serializes the specified message. /// /// The message to serialize. Must not be null. /// A non-null, non-empty value. string Serialize(T message); /// /// Deserializes a . /// /// The instance to deserialize into /// The serialized form of the to deserialize. Must not be null or empty. /// The message that contains the serialized value. May be null if no carrying message is applicable. /// The name of the parameter whose value is to be deserialized. Used for error message generation, but may be null. void Deserialize(T message, string data, IProtocolMessage containingMessage = null, string messagePartName = null); } }