Tested exception handling (#7)

This commit is contained in:
Biarity
2018-02-14 08:43:33 +10:00
parent ce4da673d9
commit b70eb3471d
6 changed files with 50 additions and 4 deletions

View File

@@ -309,8 +309,8 @@ namespace Sieve.Services
}
catch (ArgumentException) // name matched with custom method for a differnt type
{
var expected = typeof(TEntity);
var actual = ((IQueryable)customMethod.ReturnParameter).ElementType;
var expected = typeof(IQueryable<TEntity>);
var actual = customMethod.ReturnType;
throw new SieveIncompatibleMethodException(name, expected, actual,
$"{name} failed. Expected a custom method for type {expected} but only found for type {actual}");
}

View File

@@ -13,7 +13,7 @@
<description>
Sieve is a simple, clean, and extensible framework for .NET Core that adds sorting, filtering, and pagination functionality out of the box. Most common use case would be for serving ASP.NET Core GET queries. Documentation available on GitHub: https://github.com/Biarity/Sieve/
</description>
<releaseNotes>Custom method case-insensitivity</releaseNotes>
<releaseNotes>Custom method case-insensitivity, new custom exceptions</releaseNotes>
<copyright>Copyright 2018</copyright>
<tags>aspnetcore filter sort page paginate sieve search</tags>
<dependencies>