-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from NerosoftDev/develop
Develop
- Loading branch information
Showing
139 changed files
with
6,378 additions
and
285 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
Source/Euonia.Application/Interceptors/ValidationInterceptor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
namespace Nerosoft.Euonia.Collections; | ||
|
||
/// <summary> | ||
/// Represents a read-only list that enabled comparison of two instance of the <see cref="EquatableReadOnlyList{T}"/> for equality. | ||
/// </summary> | ||
/// <typeparam name="T">The element type.</typeparam> | ||
public readonly struct EquatableReadOnlyList<T> : IReadOnlyList<T>, IEquatable<EquatableReadOnlyList<T>> | ||
{ | ||
private readonly T[] _array; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="EquatableReadOnlyList{T}"/> class. | ||
/// </summary> | ||
/// <param name="items"></param> | ||
public EquatableReadOnlyList(IEnumerable<T> items) | ||
{ | ||
_array = items.ToArray(); | ||
} | ||
|
||
/// <inheritdoc /> | ||
public T this[int index] => _array[index]; | ||
|
||
/// <summary> | ||
/// Gets the element count of the list. | ||
/// </summary> | ||
public int Count => _array.Length; | ||
|
||
/// <inheritdoc /> | ||
public bool Equals(EquatableReadOnlyList<T> other) => _array.SequenceEqual(other._array); | ||
|
||
/// <inheritdoc /> | ||
public override bool Equals(object obj) => obj is EquatableReadOnlyList<T> that && Equals(that); | ||
|
||
/// <inheritdoc /> | ||
public override int GetHashCode() | ||
{ | ||
return _array.Aggregate(0, (current, item) => (current, item).GetHashCode()); | ||
} | ||
|
||
/// <summary> | ||
/// Returns an enumerator that iterates through the collection. | ||
/// </summary> | ||
/// <returns></returns> | ||
public IEnumerator<T> GetEnumerator() => _array.As<IEnumerable<T>>().GetEnumerator(); | ||
|
||
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); | ||
|
||
/// <inheritdoc /> | ||
public static bool operator ==(EquatableReadOnlyList<T> left, EquatableReadOnlyList<T> right) | ||
{ | ||
return left.Equals(right); | ||
} | ||
|
||
/// <inheritdoc /> | ||
public static bool operator !=(EquatableReadOnlyList<T> left, EquatableReadOnlyList<T> right) | ||
{ | ||
return !(left == right); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,26 @@ | ||
namespace System; | ||
|
||
/// <summary> | ||
/// Accessing services from the IoC container. | ||
/// </summary> | ||
public interface IServiceAccessor : ISingletonDependency | ||
{ | ||
/// <summary> | ||
/// Gets or sets the service provider. | ||
/// </summary> | ||
IServiceProvider ServiceProvider { get; set; } | ||
|
||
|
||
/// <summary> | ||
/// Resolves an instance of the requested type from the <see cref="ServiceProvider"/>. | ||
/// </summary> | ||
/// <typeparam name="T">The service type.</typeparam> | ||
/// <returns></returns> | ||
T GetService<T>(); | ||
|
||
/// <summary> | ||
/// Resolves an instance of the requested type from the <see cref="ServiceProvider"/>. | ||
/// </summary> | ||
/// <param name="type">The service type.</param> | ||
/// <returns></returns> | ||
object GetService(Type type); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.