Commit 3b26f4a2 authored by yuleyule66's avatar yuleyule66

fix warning

parent 49228caa
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using System; using System;
// ReSharper disable once CheckNamespace
namespace Microsoft.AspNetCore.Builder namespace Microsoft.AspNetCore.Builder
{ {
/// <summary> /// <summary>
......
...@@ -3,13 +3,14 @@ using System; ...@@ -3,13 +3,14 @@ using System;
namespace Cap.Consistency namespace Cap.Consistency
{ {
public class ConsistenceBuilder
{
/// <summary> /// <summary>
/// Creates a new instance of <see cref="ConsistenceBuilder"/>. /// Creates a new instance of <see cref="ConsistenceBuilder"/>.
/// </summary> /// </summary>
/// <param name="message">The <see cref="Type"/> to use for the message.</param> /// <param name="message">The <see cref="Type"/> to use for the message.</param>
/// <param name="services">The <see cref="IServiceCollection"/> to attach to.</param> /// <param name="service">The <see cref="IServiceCollection"/> to attach to.</param>
public class ConsistenceBuilder
{
public ConsistenceBuilder(Type message, IServiceCollection service) { public ConsistenceBuilder(Type message, IServiceCollection service) {
MessageType = message; MessageType = message;
Services = service; Services = service;
...@@ -32,10 +33,10 @@ namespace Cap.Consistency ...@@ -32,10 +33,10 @@ namespace Cap.Consistency
public Type MessageType { get; private set; } public Type MessageType { get; private set; }
/// <summary> /// <summary>
/// Adds a <see cref="IRoleStore{TRole}"/> for the <seealso cref="RoleType"/>. /// Adds a <see cref="IConsistentMessageStore{TMessage}"/> for the <seealso cref="MessageType"/>.
/// </summary> /// </summary>
/// <typeparam name="T">The role type held in the store.</typeparam> /// <typeparam name="T">The role type held in the store.</typeparam>
/// <returns>The current <see cref="IdentityBuilder"/> instance.</returns> /// <returns>The current <see cref="ConsistenceBuilder"/> instance.</returns>
public virtual ConsistenceBuilder AddMessageStore<T>() where T : class { public virtual ConsistenceBuilder AddMessageStore<T>() where T : class {
return AddScoped(typeof(IConsistentMessageStore<>).MakeGenericType(MessageType), typeof(T)); return AddScoped(typeof(IConsistentMessageStore<>).MakeGenericType(MessageType), typeof(T));
} }
......
...@@ -103,7 +103,7 @@ namespace Cap.Consistency ...@@ -103,7 +103,7 @@ namespace Cap.Consistency
/// <summary> /// <summary>
/// Finds and returns a message, if any, who has the specified <paramref name="messageId"/>. /// Finds and returns a message, if any, who has the specified <paramref name="messageId"/>.
/// </summary> /// </summary>
/// <param name="userId">The message ID to search for.</param> /// <param name="messageId">The message ID to search for.</param>
/// <returns> /// <returns>
/// The <see cref="Task"/> that represents the asynchronous operation, containing the user matching the specified <paramref name="messageId"/> if it exists. /// The <see cref="Task"/> that represents the asynchronous operation, containing the user matching the specified <paramref name="messageId"/> if it exists.
/// </returns> /// </returns>
...@@ -113,9 +113,9 @@ namespace Cap.Consistency ...@@ -113,9 +113,9 @@ namespace Cap.Consistency
} }
/// <summary> /// <summary>
/// Gets the message identifier for the specified <paramref name="user"/>. /// Gets the message identifier for the specified <paramref name="message"/>.
/// </summary> /// </summary>
/// <param name="user">The message whose identifier should be retrieved.</param> /// <param name="message">The message whose identifier should be retrieved.</param>
/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the identifier for the specified <paramref name="message"/>.</returns> /// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the identifier for the specified <paramref name="message"/>.</returns>
public virtual async Task<string> GetMessageIdAsync(TMessage message) { public virtual async Task<string> GetMessageIdAsync(TMessage message) {
ThrowIfDisposed(); ThrowIfDisposed();
......
...@@ -25,7 +25,7 @@ namespace Cap.Consistency ...@@ -25,7 +25,7 @@ namespace Cap.Consistency
/// </summary> /// </summary>
/// <param name="message">The message to create in the store.</param> /// <param name="message">The message to create in the store.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> used to propagate notifications that the operation should be canceled.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> used to propagate notifications that the operation should be canceled.</param>
/// <returns>A <see cref="Task{TResult}"/> that represents the <see cref="IdentityResult"/> of the asynchronous query.</returns> /// <returns>A <see cref="Task{TResult}"/> that represents the <see cref="OperateResult"/> of the asynchronous query.</returns>
Task<OperateResult> CreateAsync(TMessage message, CancellationToken cancellationToken); Task<OperateResult> CreateAsync(TMessage message, CancellationToken cancellationToken);
/// <summary> /// <summary>
...@@ -33,7 +33,7 @@ namespace Cap.Consistency ...@@ -33,7 +33,7 @@ namespace Cap.Consistency
/// </summary> /// </summary>
/// <param name="message">The message to update in the store.</param> /// <param name="message">The message to update in the store.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> used to propagate notifications that the operation should be canceled.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> used to propagate notifications that the operation should be canceled.</param>
/// <returns>A <see cref="Task{TResult}"/> that represents the <see cref="IdentityResult"/> of the asynchronous query.</returns> /// <returns>A <see cref="Task{TResult}"/> that represents the <see cref="OperateResult"/> of the asynchronous query.</returns>
Task<OperateResult> UpdateAsync(TMessage message, CancellationToken cancellationToken); Task<OperateResult> UpdateAsync(TMessage message, CancellationToken cancellationToken);
/// <summary> /// <summary>
...@@ -41,7 +41,7 @@ namespace Cap.Consistency ...@@ -41,7 +41,7 @@ namespace Cap.Consistency
/// </summary> /// </summary>
/// <param name="message">The message to delete in the store.</param> /// <param name="message">The message to delete in the store.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> used to propagate notifications that the operation should be canceled.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> used to propagate notifications that the operation should be canceled.</param>
/// <returns>A <see cref="Task{TResult}"/> that represents the <see cref="IdentityResult"/> of the asynchronous query.</returns> /// <returns>A <see cref="Task{TResult}"/> that represents the <see cref="OperateResult"/> of the asynchronous query.</returns>
Task<OperateResult> DeleteAsync(TMessage message, CancellationToken cancellationToken); Task<OperateResult> DeleteAsync(TMessage message, CancellationToken cancellationToken);
/// <summary> /// <summary>
......
...@@ -8,7 +8,10 @@ namespace Cap.Consistency ...@@ -8,7 +8,10 @@ namespace Cap.Consistency
/// </summary> /// </summary>
public class OperateResult public class OperateResult
{ {
// ReSharper disable once InconsistentNaming
private static readonly OperateResult _success = new OperateResult { Succeeded = true }; private static readonly OperateResult _success = new OperateResult { Succeeded = true };
// ReSharper disable once FieldCanBeMadeReadOnly.Local
private List<OperateError> _errors = new List<OperateError>(); private List<OperateError> _errors = new List<OperateError>();
/// <summary> /// <summary>
...@@ -24,16 +27,16 @@ namespace Cap.Consistency ...@@ -24,16 +27,16 @@ namespace Cap.Consistency
public IEnumerable<OperateError> Errors => _errors; public IEnumerable<OperateError> Errors => _errors;
/// <summary> /// <summary>
/// Returns an <see cref="IdentityResult"/> indicating a successful identity operation. /// Returns an <see cref="OperateResult"/> indicating a successful identity operation.
/// </summary> /// </summary>
/// <returns>An <see cref="IdentityResult"/> indicating a successful operation.</returns> /// <returns>An <see cref="OperateResult"/> indicating a successful operation.</returns>
public static OperateResult Success => _success; public static OperateResult Success => _success;
/// <summary> /// <summary>
/// Creates an <see cref="IdentityResult"/> indicating a failed operation, with a list of <paramref name="errors"/> if applicable. /// Creates an <see cref="OperateResult"/> indicating a failed operation, with a list of <paramref name="errors"/> if applicable.
/// </summary> /// </summary>
/// <param name="errors">An optional array of <see cref="IdentityError"/>s which caused the operation to fail.</param> /// <param name="errors">An optional array of <see cref="OperateError"/>s which caused the operation to fail.</param>
/// <returns>An <see cref="IdentityResult"/> indicating a failed operation, with a list of <paramref name="errors"/> if applicable.</returns> /// <returns>An <see cref="OperateResult"/> indicating a failed operation, with a list of <paramref name="errors"/> if applicable.</returns>
public static OperateResult Failed(params OperateError[] errors) { public static OperateResult Failed(params OperateError[] errors) {
var result = new OperateResult { Succeeded = false }; var result = new OperateResult { Succeeded = false };
if (errors != null) { if (errors != null) {
...@@ -43,9 +46,9 @@ namespace Cap.Consistency ...@@ -43,9 +46,9 @@ namespace Cap.Consistency
} }
/// <summary> /// <summary>
/// Converts the value of the current <see cref="IdentityResult"/> object to its equivalent string representation. /// Converts the value of the current <see cref="OperateResult"/> object to its equivalent string representation.
/// </summary> /// </summary>
/// <returns>A string representation of the current <see cref="IdentityResult"/> object.</returns> /// <returns>A string representation of the current <see cref="OperateResult"/> object.</returns>
/// <remarks> /// <remarks>
/// If the operation was successful the ToString() will return "Succeeded" otherwise it returned /// If the operation was successful the ToString() will return "Succeeded" otherwise it returned
/// "Failed : " followed by a comma delimited list of error codes from its <see cref="Errors"/> collection, if any. /// "Failed : " followed by a comma delimited list of error codes from its <see cref="Errors"/> collection, if any.
......
using Cap.Consistency; using Cap.Consistency;
using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.DependencyInjection.Extensions;
// ReSharper disable once CheckNamespace
namespace Microsoft.Extensions.DependencyInjection namespace Microsoft.Extensions.DependencyInjection
{ {
/// <summary> /// <summary>
......
{ {
"version": "1.0.0-*", "version": "1.0.0-*",
"dependencies": { "dependencies": {
"Microsoft.AspNetCore.Http.Abstractions": "1.1.0-*", "Microsoft.AspNetCore.Http.Abstractions": "1.1.0-*",
"Microsoft.Extensions.DependencyInjection.Abstractions": "1.1.0", "Microsoft.Extensions.DependencyInjection.Abstractions": "1.1.0",
"Microsoft.Extensions.Logging.Abstractions": "1.1.0-*", "Microsoft.Extensions.Logging.Abstractions": "1.1.0-*",
"NETStandard.Library": "1.6.1" "NETStandard.Library": "1.6.1"
}, },
"frameworks": { "frameworks": {
"netstandard1.6": { "netstandard1.6": {
"imports": "dnxcore50" "imports": "dnxcore50"
......
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