diff --git a/src/DotNetCore.CAP/Abstractions/IContentSerializer.cs b/src/DotNetCore.CAP/Abstractions/IContentSerializer.cs index e51887e..402843a 100644 --- a/src/DotNetCore.CAP/Abstractions/IContentSerializer.cs +++ b/src/DotNetCore.CAP/Abstractions/IContentSerializer.cs @@ -3,19 +3,58 @@ using DotNetCore.CAP.Models; namespace DotNetCore.CAP.Abstractions { + /// + /// Message content serializer. + /// By default, CAP will use Json as a serializer, and you can customize this interface to achieve serialization of other methods. + /// public interface IContentSerializer { - string Serialize(T obj); + /// + /// Serializes the specified object to a string. + /// + /// The type of the value being serialized. + /// The object to serialize. + /// A string representation of the object. + string Serialize(T value); - T DeSerialize(string content); + /// + /// Deserializes the string to the specified .NET type. + /// + /// The type of the object to deserialize to. + /// The content string to deserialize. + /// The deserialized object from the string. + T DeSerialize(string value); - object DeSerialize(string content, Type type); + /// + /// Deserializes the string to the specified .NET type. + /// + /// The string to deserialize. + /// The type of the object to deserialize to. + /// The deserialized object from the string. + object DeSerialize(string value, Type type); } + /// + /// CAP message content wapper. + /// You can customize the message body filed name of the wrapper or add fields that you interested. + /// + /// + /// We use the wrapper to provide some additional information for the message content,which is important for CAP。 + /// Typically, we may need to customize the field display name of the message, + /// which includes interacting with other message components, which can be adapted in this manner + /// public interface IMessagePacker { + /// + /// Package a message object + /// + /// The obj message to be packed. string Pack(CapMessage obj); + /// + /// Unpack a message strings to object. + /// + /// The string of packed message. CapMessage UnPack(string packingMessage); - } + } } \ No newline at end of file diff --git a/src/DotNetCore.CAP/Abstractions/IModelBinderFactory.cs b/src/DotNetCore.CAP/Abstractions/IModelBinderFactory.cs index 61330c3..df3423f 100644 --- a/src/DotNetCore.CAP/Abstractions/IModelBinderFactory.cs +++ b/src/DotNetCore.CAP/Abstractions/IModelBinderFactory.cs @@ -3,8 +3,16 @@ using DotNetCore.CAP.Abstractions.ModelBinding; namespace DotNetCore.CAP.Abstractions { + /// + /// Model binder factory. + /// public interface IModelBinderFactory { + /// + /// Create a model binder by parameter. + /// + /// The method parameter info + /// A model binder instance. IModelBinder CreateBinder(ParameterInfo parameter); } } \ No newline at end of file diff --git a/src/DotNetCore.CAP/Abstractions/ISubscriberExecutor.cs b/src/DotNetCore.CAP/Abstractions/ISubscriberExecutor.cs index 062cad2..18c9f5d 100644 --- a/src/DotNetCore.CAP/Abstractions/ISubscriberExecutor.cs +++ b/src/DotNetCore.CAP/Abstractions/ISubscriberExecutor.cs @@ -3,8 +3,15 @@ using DotNetCore.CAP.Models; namespace DotNetCore.CAP.Abstractions { + /// + /// Consumer method executor. + /// public interface ISubscriberExecutor { + /// + /// Execute the consumer method. + /// + /// The received message. Task ExecuteAsync(CapReceivedMessage receivedMessage); } } diff --git a/src/DotNetCore.CAP/Abstractions/TopicAttribute.cs b/src/DotNetCore.CAP/Abstractions/TopicAttribute.cs index 9fcdd8b..454572f 100644 --- a/src/DotNetCore.CAP/Abstractions/TopicAttribute.cs +++ b/src/DotNetCore.CAP/Abstractions/TopicAttribute.cs @@ -4,7 +4,7 @@ namespace DotNetCore.CAP.Abstractions { /// /// - /// An abstract attribute that for kafka attribute or rabbit mq attribute + /// An abstract attribute that for kafka attribute or rabbit mq attribute /// [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = true)] public abstract class TopicAttribute : Attribute @@ -15,7 +15,7 @@ namespace DotNetCore.CAP.Abstractions } /// - /// topic or exchange route key name. + /// Topic or exchange route key name. /// public string Name { get; }