Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax IN dont work with Enums #63

Closed
writeless opened this issue Mar 26, 2017 · 1 comment
Closed

Syntax IN dont work with Enums #63

writeless opened this issue Mar 26, 2017 · 1 comment

Comments

@writeless
Copy link

Nice work in this lib, thank you, but I have a problem with syntax IN and Enums.

Expression work: (type == ("KeyAccount"))
Expression dont work: (type IN ("KeyAccount", "Support"))

Versions:
"System.Linq.Dynamic.Core": "1.0.6.10"
"Microsoft.EntityFrameworkCore.SqlServer": "1.1.1"

Code detail:

public class Vendor
{
	public VendorType Type { get; private set; }
}
public enum VendorType
{
	KeyAccount = 1,
	Support,
	BackOffice,
	Dealer,
}

Exception details:
System.Linq.Dynamic.Core.Exceptions.ParseException occurred
HResult=0x80131500
Message=Expression of type 'EletraEA.Sales.Domain.Entities.VendorType' expected
Source=System.Linq.Dynamic.Core
StackTrace:
at System.Linq.Dynamic.Core.ExpressionParser.ParseIn()
at System.Linq.Dynamic.Core.ExpressionParser.ParseConditionalAnd()
at System.Linq.Dynamic.Core.ExpressionParser.ParseConditionalOr()
at System.Linq.Dynamic.Core.ExpressionParser.ParseNullCoalescing()
at System.Linq.Dynamic.Core.ExpressionParser.ParseExpression()
at System.Linq.Dynamic.Core.ExpressionParser.ParseParenExpression()
at System.Linq.Dynamic.Core.ExpressionParser.ParsePrimary()
at System.Linq.Dynamic.Core.ExpressionParser.ParseUnary()
at System.Linq.Dynamic.Core.ExpressionParser.ParseMultiplicative()
at System.Linq.Dynamic.Core.ExpressionParser.ParseAdditive()
at System.Linq.Dynamic.Core.ExpressionParser.ParseShift()
at System.Linq.Dynamic.Core.ExpressionParser.ParseComparison()
at System.Linq.Dynamic.Core.ExpressionParser.ParseConditionalAnd()
at System.Linq.Dynamic.Core.ExpressionParser.ParseConditionalOr()
at System.Linq.Dynamic.Core.ExpressionParser.ParseNullCoalescing()
at System.Linq.Dynamic.Core.ExpressionParser.ParseExpression()
at System.Linq.Dynamic.Core.ExpressionParser.Parse(Type resultType, Boolean createParameterCtor)
at System.Linq.Dynamic.Core.DynamicExpressionParser.ParseLambda(Boolean createParameterCtor, ParameterExpression[] parameters, Type resultType, String expression, Object[] values)
at System.Linq.Dynamic.Core.DynamicQueryableExtensions.Where(IQueryable source, String predicate, Object[] args)
at System.Linq.Dynamic.Core.DynamicQueryableExtensions.Where[TSource](IQueryable1 source, String predicate, Object[] args) at Writeless.Data.Extensions.IQueryableContextExtensions.ApplyFilters[T](IQueryable1 query, GenericFilters filters) in E:\projetos\TFS\Git\EletraEA\EletraEA\src\Writeless\Writeless.Data\Extensions\IQueryableContextExtensions.cs:line 70
at Writeless.Data.Extensions.IQueryableContextExtensions.GetPaged[TEntity,TDto](IQueryableContext context, PagingOptions options, GenericFilters filters) in E:\projetos\TFS\Git\EletraEA\EletraEA\src\Writeless\Writeless.Data\Extensions\IQueryableContextExtensions.cs:line 38
at EletraEA.Sales.Data.Repositories.VendorQueryRepository.GetPaged[T](PagingOptions options, GenericFilters filters) in E:\projetos\TFS\Git\EletraEA\EletraEA\src\Sales\EletraEA.Sales.Data\Repositories\VendorQueryRepository.cs:line 40
at EletraEA.Sales.Application.AppServices.VendorAppService.GetPaged(Int32 currentPage, Int32 pageSize, String sortExpression, GenericFilters filters) in E:\projetos\TFS\Git\EletraEA\EletraEA\src\Sales\EletraEA.Sales.Application\AppServices\VendorAppService.cs:line 25
at EletraEA.UI.Api.EletraEA.Controllers.Sales.VendorsController.Get(Int32 currentPage, Int32 pageSize, String sortExpression, String[] p, ComparisonOperator[] c, LogicalOperator[] l, String[] v) in E:\projetos\TFS\Git\EletraEA\EletraEA\src\UI\Api\EletraEA.UI.Api.EletraEA\Controllers\Sales\VendorsController.cs:line 37
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__27.MoveNext()

StefH added a commit that referenced this issue Apr 9, 2017
@StefH
Copy link
Collaborator

StefH commented Apr 9, 2017

@StefH StefH closed this as completed Apr 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant