Commit 59025d21 authored by Savorboard's avatar Savorboard

add summary comments.

parent 04ef816e
......@@ -3,19 +3,58 @@ using DotNetCore.CAP.Models;
namespace DotNetCore.CAP.Abstractions
{
/// <summary>
/// Message content serializer.
/// <para>By default, CAP will use Json as a serializer, and you can customize this interface to achieve serialization of other methods.</para>
/// </summary>
public interface IContentSerializer
{
string Serialize<T>(T obj);
/// <summary>
/// Serializes the specified object to a string.
/// </summary>
/// <typeparam name="T"> The type of the value being serialized.</typeparam>
/// <param name="value">The object to serialize.</param>
/// <returns>A string representation of the object.</returns>
string Serialize<T>(T value);
T DeSerialize<T>(string content);
/// <summary>
/// Deserializes the string to the specified .NET type.
/// </summary>
/// <typeparam name="T">The type of the object to deserialize to.</typeparam>
/// <param name="value">The content string to deserialize.</param>
/// <returns>The deserialized object from the string.</returns>
T DeSerialize<T>(string value);
object DeSerialize(string content, Type type);
/// <summary>
/// Deserializes the string to the specified .NET type.
/// </summary>
/// <param name="value">The string to deserialize.</param>
/// <param name="type">The type of the object to deserialize to.</param>
/// <returns>The deserialized object from the string.</returns>
object DeSerialize(string value, Type type);
}
/// <summary>
/// CAP message content wapper.
/// <para>You can customize the message body filed name of the wrapper or add fields that you interested.</para>
/// </summary>
/// <remarks>
/// 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
/// </remarks>
public interface IMessagePacker
{
/// <summary>
/// Package a message object
/// </summary>
/// <param name="obj">The obj message to be packed.</param>
string Pack(CapMessage obj);
/// <summary>
/// Unpack a message strings to <see cref="CapMessage"/> object.
/// </summary>
/// <param name="packingMessage">The string of packed message.</param>
CapMessage UnPack(string packingMessage);
}
}
\ No newline at end of file
......@@ -3,8 +3,16 @@ using DotNetCore.CAP.Abstractions.ModelBinding;
namespace DotNetCore.CAP.Abstractions
{
/// <summary>
/// Model binder factory.
/// </summary>
public interface IModelBinderFactory
{
/// <summary>
/// Create a model binder by parameter.
/// </summary>
/// <param name="parameter">The method parameter info</param>
/// <returns>A model binder instance.</returns>
IModelBinder CreateBinder(ParameterInfo parameter);
}
}
\ No newline at end of file
......@@ -3,8 +3,15 @@ using DotNetCore.CAP.Models;
namespace DotNetCore.CAP.Abstractions
{
/// <summary>
/// Consumer method executor.
/// </summary>
public interface ISubscriberExecutor
{
/// <summary>
/// Execute the consumer method.
/// </summary>
/// <param name="receivedMessage">The received message.</param>
Task<OperateResult> ExecuteAsync(CapReceivedMessage receivedMessage);
}
}
......@@ -15,7 +15,7 @@ namespace DotNetCore.CAP.Abstractions
}
/// <summary>
/// topic or exchange route key name.
/// Topic or exchange route key name.
/// </summary>
public string Name { get; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment