diff --git a/src/DotNetCore.CAP/Abstractions/ConsumerContext.cs b/src/DotNetCore.CAP/Abstractions/ConsumerContext.cs index e700541..cd628aa 100644 --- a/src/DotNetCore.CAP/Abstractions/ConsumerContext.cs +++ b/src/DotNetCore.CAP/Abstractions/ConsumerContext.cs @@ -3,16 +3,30 @@ using DotNetCore.CAP.Infrastructure; namespace DotNetCore.CAP.Abstractions { + /// + /// A context for consumers, it used to be provider wapper of method description and received message. + /// public class ConsumerContext { + /// + /// create a new instance of . + /// + /// consumer method descriptor. + /// reveied message. public ConsumerContext(ConsumerExecutorDescriptor descriptor, DeliverMessage message) { ConsumerDescriptor = descriptor ?? throw new ArgumentNullException(nameof(descriptor)); DeliverMessage = message ?? throw new ArgumentNullException(nameof(message)); } + /// + /// a descriptor of consumer information need to be performed. + /// public ConsumerExecutorDescriptor ConsumerDescriptor { get; set; } + /// + /// consumer reveived message. + /// public DeliverMessage DeliverMessage { get; set; } } } \ No newline at end of file diff --git a/src/DotNetCore.CAP/Abstractions/ConsumerExecutorDescriptor.cs b/src/DotNetCore.CAP/Abstractions/ConsumerExecutorDescriptor.cs index ef50933..e95e337 100644 --- a/src/DotNetCore.CAP/Abstractions/ConsumerExecutorDescriptor.cs +++ b/src/DotNetCore.CAP/Abstractions/ConsumerExecutorDescriptor.cs @@ -2,6 +2,9 @@ namespace DotNetCore.CAP.Abstractions { + /// + /// A descriptor of user definition method. + /// public class ConsumerExecutorDescriptor { public MethodInfo MethodInfo { get; set; } diff --git a/src/DotNetCore.CAP/Abstractions/ConsumerInvokerContext.cs b/src/DotNetCore.CAP/Abstractions/ConsumerInvokerContext.cs index cedea1a..613ed97 100644 --- a/src/DotNetCore.CAP/Abstractions/ConsumerInvokerContext.cs +++ b/src/DotNetCore.CAP/Abstractions/ConsumerInvokerContext.cs @@ -2,6 +2,9 @@ namespace DotNetCore.CAP.Abstractions { + /// + /// a context of consumer invoker. + /// public class ConsumerInvokerContext { public ConsumerInvokerContext(ConsumerContext consumerContext) diff --git a/src/DotNetCore.CAP/Abstractions/IConsumerInvoker.cs b/src/DotNetCore.CAP/Abstractions/IConsumerInvoker.cs index ede8fa3..00f37d6 100644 --- a/src/DotNetCore.CAP/Abstractions/IConsumerInvoker.cs +++ b/src/DotNetCore.CAP/Abstractions/IConsumerInvoker.cs @@ -2,8 +2,14 @@ namespace DotNetCore.CAP.Abstractions { + /// + /// Perform user definition method of consumers. + /// public interface IConsumerInvoker { + /// + /// begin to invoke method. + /// Task InvokeAsync(); } } \ No newline at end of file diff --git a/src/DotNetCore.CAP/Abstractions/ModelBinding/IModelBinder.cs b/src/DotNetCore.CAP/Abstractions/ModelBinding/IModelBinder.cs index 3b87c51..dbfa344 100644 --- a/src/DotNetCore.CAP/Abstractions/ModelBinding/IModelBinder.cs +++ b/src/DotNetCore.CAP/Abstractions/ModelBinding/IModelBinder.cs @@ -2,8 +2,28 @@ namespace DotNetCore.CAP.Abstractions.ModelBinding { + /// + /// Defines an interface for model binders. + /// public interface IModelBinder { + /// + /// Attempts to bind a model. + /// + /// The . + /// + /// + /// A which will complete when the model binding process completes. + /// + /// + /// If model binding was successful, the should have + /// set to true. + /// + /// + /// A model binder that completes successfully should set to + /// a value returned from . + /// + /// Task BindModelAsync(ModelBindingContext bindingContext); } } \ No newline at end of file diff --git a/src/DotNetCore.CAP/Abstractions/ModelBinding/ModelBindingContext.cs b/src/DotNetCore.CAP/Abstractions/ModelBinding/ModelBindingContext.cs index 9b57fe1..0715074 100644 --- a/src/DotNetCore.CAP/Abstractions/ModelBinding/ModelBindingContext.cs +++ b/src/DotNetCore.CAP/Abstractions/ModelBinding/ModelBindingContext.cs @@ -3,18 +3,45 @@ using Microsoft.Extensions.Primitives; namespace DotNetCore.CAP.Abstractions.ModelBinding { + // + /// A context that contains operating information for model binding and validation. + /// public class ModelBindingContext { + /// + /// Gets or sets the model value for the current operation. + /// + /// + /// The will typically be set for a binding operation that works + /// against a pre-existing model object to update certain properties. + /// public object Model { get; set; } + /// + /// Gets or sets the name of the model. + /// public string ModelName { get; set; } + /// + /// Gets or sets the type of the model. + /// public Type ModelType { get; set; } + /// + /// Gets or sets the values of the model. + /// public StringValues Values { get; set; } + /// + /// + /// Gets or sets a result which represents the result of the model binding process. + /// + /// public object Result { get; set; } + /// + /// Creates a new for top-level model binding operation. + /// public static ModelBindingContext CreateBindingContext(string values, string modelName, Type modelType) { return new ModelBindingContext() diff --git a/src/DotNetCore.CAP/Abstractions/TopicAttribute.cs b/src/DotNetCore.CAP/Abstractions/TopicAttribute.cs index 195af85..a4a8cb0 100644 --- a/src/DotNetCore.CAP/Abstractions/TopicAttribute.cs +++ b/src/DotNetCore.CAP/Abstractions/TopicAttribute.cs @@ -2,6 +2,9 @@ namespace DotNetCore.CAP.Abstractions { + /// + /// An abstract attribute that for kafka attribute or rabbitmq attribute + /// [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, Inherited = true, AllowMultiple = true)] public abstract class TopicAttribute : Attribute { @@ -12,11 +15,17 @@ namespace DotNetCore.CAP.Abstractions this._name = topicName; } + /// + /// topic or exchange route key name. + /// public string Name { get { return _name; } } + /// + /// the consumer group. + /// public string GroupOrExchange { get; set; } public bool IsOneWay { get; set; } diff --git a/src/DotNetCore.CAP/CAP.Builder.cs b/src/DotNetCore.CAP/CAP.Builder.cs index 8ca1931..1273582 100644 --- a/src/DotNetCore.CAP/CAP.Builder.cs +++ b/src/DotNetCore.CAP/CAP.Builder.cs @@ -49,7 +49,7 @@ namespace Microsoft.Extensions.DependencyInjection return AddSingleton(); } - public virtual CapBuilder AddProducerClient() + public virtual CapBuilder AddProducerService() where T : class, ICapProducerService { return AddScoped(typeof(ICapProducerService), typeof(T)); diff --git a/src/DotNetCore.CAP/DotNetCore.CAP.csproj b/src/DotNetCore.CAP/DotNetCore.CAP.csproj index 0554fe9..7875f81 100644 --- a/src/DotNetCore.CAP/DotNetCore.CAP.csproj +++ b/src/DotNetCore.CAP/DotNetCore.CAP.csproj @@ -19,7 +19,7 @@ - +