Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Commit

Permalink
Encrypted distincts
Browse files Browse the repository at this point in the history
  • Loading branch information
DefGh committed Jan 16, 2024
1 parent b1c06e4 commit 5b494bd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ public static DistinctColumnValuesResult DistinctColumnValues<TModel>(this IQuer
throw new PropertyNotFoundException($"Property {columnName} not found in {typeof(TModel).Name}");

var mappedToPropertyAttribute = targetProperty.GetCustomAttribute<MappedToPropertyAttribute>()!;
if (mappedToPropertyAttribute.Encrypted)
return new();
/*if (mappedToPropertyAttribute.Encrypted)
return new();*/

var propertyType = PropertyHelper.GetPropertyType(typeof(TModel), mappedToPropertyAttribute);

Expand All @@ -86,7 +86,7 @@ public static DistinctColumnValuesResult DistinctColumnValues<TModel>(this IQuer

var property = PropertyHelper.GetPropertyLambda(mappedToPropertyAttribute);

if (propertyType.IsIEnumerable())
if (propertyType.IsIEnumerable() && !mappedToPropertyAttribute.Encrypted)
{
query2 = (IQueryable<object>)query.Select(property).SelectMany("x => x");
}
Expand Down Expand Up @@ -137,8 +137,8 @@ public static async Task<DistinctColumnValuesResult> DistinctColumnValuesAsync<T
throw new PropertyNotFoundException($"Property {columnName} not found in {typeof(TModel).Name}");

var mappedToPropertyAttribute = targetProperty.GetCustomAttribute<MappedToPropertyAttribute>()!;
if (mappedToPropertyAttribute.Encrypted)
return new();
/*if (mappedToPropertyAttribute.Encrypted)
return new();*/

var propertyType = PropertyHelper.GetPropertyType(typeof(TModel), mappedToPropertyAttribute);

Expand Down
2 changes: 1 addition & 1 deletion IEnumerableExtenders/Extensions/FilterExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static IQueryable<TModel> ApplyFilters<TModel>(this IQueryable<TModel> db


var targetType = PropertyHelper.GetPropertyType(typeof(TModel), mappedToPropertyAttribute);
if (targetType.IsIEnumerable() && targetType != typeof(byte[]))
if (targetType.IsIEnumerable() && !mappedToPropertyAttribute.Encrypted)
targetType = targetType.GetCollectionType();
var method = typeof(PropertyHelper).GetMethod("GetValues")!.MakeGenericMethod(targetType);
var values = method.Invoke(null, [filter, mappedToPropertyAttribute]);
Expand Down
2 changes: 1 addition & 1 deletion IEnumerableExtenders/IEnumerableExtenders.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>PandaTech.IEnumerableFilters</RootNamespace>
<Version>4.0.13</Version>
<Version>4.0.14</Version>
<Authors>PandaTech</Authors>
<Description>This NuGet helps with filtering tables.</Description>
<RepositoryUrl>https://github.com/PandaTechAM/be-lib-ienumerable-extenders-filters.git</RepositoryUrl>
Expand Down

0 comments on commit 5b494bd

Please sign in to comment.