mirror of
https://github.com/Biarity/Sieve.git
synced 2024-11-21 21:12:50 +01:00
Style fixes
This commit is contained in:
parent
a582c6be06
commit
6652ada702
@ -1,5 +1,5 @@
|
|||||||
using Sieve.Models;
|
using System;
|
||||||
using System;
|
using Sieve.Models;
|
||||||
|
|
||||||
namespace Sieve.Attributes
|
namespace Sieve.Attributes
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace Sieve.Extensions
|
namespace Sieve.Extensions
|
||||||
{
|
{
|
||||||
|
@ -11,8 +11,8 @@ namespace Sieve.Extensions
|
|||||||
bool desc, bool useThenBy)
|
bool desc, bool useThenBy)
|
||||||
{
|
{
|
||||||
string command = desc ?
|
string command = desc ?
|
||||||
( useThenBy ? "ThenByDescending" : "OrderByDescending") :
|
(useThenBy ? "ThenByDescending" : "OrderByDescending") :
|
||||||
( useThenBy ? "ThenBy" : "OrderBy");
|
(useThenBy ? "ThenBy" : "OrderBy");
|
||||||
var type = typeof(TEntity);
|
var type = typeof(TEntity);
|
||||||
var parameter = Expression.Parameter(type, "p");
|
var parameter = Expression.Parameter(type, "p");
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace Sieve.Models
|
namespace Sieve.Models
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Runtime.Serialization;
|
using System.Runtime.Serialization;
|
||||||
|
@ -356,7 +356,7 @@ namespace Sieve.Services
|
|||||||
string name)
|
string name)
|
||||||
{
|
{
|
||||||
var property = mapper.FindProperty<TEntity>(canSortRequired, canFilterRequired, name, _options.Value.CaseSensitive);
|
var property = mapper.FindProperty<TEntity>(canSortRequired, canFilterRequired, name, _options.Value.CaseSensitive);
|
||||||
if(property.Item1 == null)
|
if (property.Item1 == null)
|
||||||
{
|
{
|
||||||
var prop = FindPropertyBySieveAttribute<TEntity>(canSortRequired, canFilterRequired, name, _options.Value.CaseSensitive);
|
var prop = FindPropertyBySieveAttribute<TEntity>(canSortRequired, canFilterRequired, name, _options.Value.CaseSensitive);
|
||||||
return (prop?.Name, prop);
|
return (prop?.Name, prop);
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
using Sieve.Models;
|
using System;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using Sieve.Models;
|
||||||
|
|
||||||
namespace Sieve.Services
|
namespace Sieve.Services
|
||||||
{
|
{
|
||||||
@ -14,7 +14,7 @@ namespace Sieve.Services
|
|||||||
|
|
||||||
public PropertyFluentApi<TEntity> Property<TEntity>(Expression<Func<TEntity, object>> expression)
|
public PropertyFluentApi<TEntity> Property<TEntity>(Expression<Func<TEntity, object>> expression)
|
||||||
{
|
{
|
||||||
if(!_map.ContainsKey(typeof(TEntity)))
|
if (!_map.ContainsKey(typeof(TEntity)))
|
||||||
{
|
{
|
||||||
_map.Add(typeof(TEntity), new List<KeyValuePair<PropertyInfo, ISievePropertyMetadata>>());
|
_map.Add(typeof(TEntity), new List<KeyValuePair<PropertyInfo, ISievePropertyMetadata>>());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user