Skip to content

Commit

Permalink
Merge pull request #42 from khellang/xml-docs
Browse files Browse the repository at this point in the history
Filled in missing XML docs
  • Loading branch information
jbogard committed Aug 4, 2015
2 parents 395aec6 + c7b1bf0 commit 61cd37c
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 5 deletions.
7 changes: 6 additions & 1 deletion src/MediatR/Mediator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,19 @@ namespace MediatR
using System.Threading.Tasks;

/// <summary>
/// Default mediator implementation relying on Common Service Locator for resolving handlers
/// Default mediator implementation relying on single- and multi instance delegates for resolving handlers.
/// </summary>
public class Mediator : IMediator
{
private readonly SingleInstanceFactory _singleInstanceFactory;

private readonly MultiInstanceFactory _multiInstanceFactory;

/// <summary>
/// Initializes a new instance of the <see cref="Mediator"/> class.
/// </summary>
/// <param name="singleInstanceFactory">The single instance factory.</param>
/// <param name="multiInstanceFactory">The multi instance factory.</param>
public Mediator(SingleInstanceFactory singleInstanceFactory, MultiInstanceFactory multiInstanceFactory)
{
_singleInstanceFactory = singleInstanceFactory;
Expand Down
3 changes: 2 additions & 1 deletion src/MediatR/MultiInstanceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
namespace MediatR
{
/// <summary>
/// Factory method for creating multiple instances. Used to build instances of <see cref="INotificationHandler{TNotification}"/> and <see cref="IAsyncNotificationHandler{TNotification}"/>
/// Factory method for creating multiple instances. Used to build instances of
/// <see cref="INotificationHandler{TNotification}"/> and <see cref="IAsyncNotificationHandler{TNotification}"/>
/// </summary>
/// <param name="serviceType">Type of service to resolve</param>
/// <returns>An enumerable of instances of type <paramref name="serviceType" /></returns>
Expand Down
3 changes: 2 additions & 1 deletion src/MediatR/SingleInstanceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
namespace MediatR
{
/// <summary>
/// Factory method for creating single instances. Used to build instances of <see cref="IRequestHandler{TRequest,TResponse}"/> and <see cref="IAsyncRequestHandler{TRequest,TResponse}"/>
/// Factory method for creating single instances. Used to build instances of
/// <see cref="IRequestHandler{TRequest,TResponse}"/> and <see cref="IAsyncRequestHandler{TRequest,TResponse}"/>
/// </summary>
/// <param name="serviceType">Type of service to resolve</param>
/// <returns>An instance of type <paramref name="serviceType" /></returns>
Expand Down
62 changes: 60 additions & 2 deletions src/MediatR/Unit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,108 @@
using System;

/// <summary>
/// Represents a Void type, since Void is not a valid type in C#
/// Represents a void type, since <see cref="System.Void"/> is not a valid return type in C#.
/// </summary>
public struct Unit : IEquatable<Unit>, IComparable<Unit>, IComparable
{
/// <summary>
/// Default and only value of Unit type
/// Default and only value of the <see cref="Unit"/> type.
/// </summary>
public static readonly Unit Value = new Unit();

/// <summary>
/// Compares the current object with another object of the same type.
/// </summary>
/// <param name="other">An object to compare with this object.</param>
/// <returns>
/// A value that indicates the relative order of the objects being compared.
/// The return value has the following meanings:
/// - Less than zero: This object is less than the <paramref name="other" /> parameter.
/// - Zero: This object is equal to <paramref name="other" />.
/// - Greater than zero: This object is greater than <paramref name="other" />.
/// </returns>
public int CompareTo(Unit other)
{
return 0;
}

/// <summary>
/// Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
/// </summary>
/// <param name="obj">An object to compare with this instance.</param>
/// <returns>
/// A value that indicates the relative order of the objects being compared.
/// The return value has these meanings:
/// - Less than zero: This instance precedes <paramref name="obj" /> in the sort order.
/// - Zero: This instance occurs in the same position in the sort order as <paramref name="obj" />.
/// - Greater than zero: This instance follows <paramref name="obj" /> in the sort order.
/// </returns>
int IComparable.CompareTo(object obj)
{
return 0;
}

/// <summary>
/// Returns a hash code for this instance.
/// </summary>
/// <returns>
/// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
/// </returns>
public override int GetHashCode()
{
return 0;
}

/// <summary>
/// Determines whether the current object is equal to another object of the same type.
/// </summary>
/// <param name="other">An object to compare with this object.</param>
/// <returns>
/// <c>true</c> if the current object is equal to the <paramref name="other" /> parameter; otherwise, <c>false</c>.
/// </returns>
public bool Equals(Unit other)
{
return true;
}

/// <summary>
/// Determines whether the specified <see cref="System.Object" /> is equal to this instance.
/// </summary>
/// <param name="obj">The object to compare with the current instance.</param>
/// <returns>
/// <c>true</c> if the specified <see cref="System.Object" /> is equal to this instance; otherwise, <c>false</c>.
/// </returns>
public override bool Equals(object obj)
{
return obj is Unit;
}

/// <summary>
/// Determines whether the <paramref name="first"/> object is equal to the <paramref name="second"/> object.
/// </summary>
/// <param name="first">The first object.</param>
/// <param name="second">The second object.</param>
/// <c>true</c> if the <paramref name="first"/> object is equal to the <paramref name="second" /> object; otherwise, <c>false</c>.
public static bool operator ==(Unit first, Unit second)
{
return true;
}

/// <summary>
/// Determines whether the <paramref name="first"/> object is not equal to the <paramref name="second"/> object.
/// </summary>
/// <param name="first">The first object.</param>
/// <param name="second">The second object.</param>
/// <c>true</c> if the <paramref name="first"/> object is not equal to the <paramref name="second" /> object; otherwise, <c>false</c>.
public static bool operator !=(Unit first, Unit second)
{
return false;
}

/// <summary>
/// Returns a <see cref="System.String" /> that represents this instance.
/// </summary>
/// <returns>A <see cref="System.String" /> that represents this instance.</returns>
public override string ToString()
{
return "()";
Expand Down

0 comments on commit 61cd37c

Please sign in to comment.