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

Methods on type 'Enum' are not accessible. #696

Closed
DamienLaw opened this issue Mar 30, 2023 · 2 comments
Closed

Methods on type 'Enum' are not accessible. #696

DamienLaw opened this issue Mar 30, 2023 · 2 comments
Assignees
Labels

Comments

@DamienLaw
Copy link

DamienLaw commented Mar 30, 2023

I'm using [email protected] which has a dependency on [email protected] and I'm getting an exception Methods on type 'Enum' are not accessible (at index 3) with query

var status = Status.Active | Status.Inactive;
query = query.Where("@0.HasFlag(StatusColumn)", status); // I believe Enum.HasFlag() is triggering the error.

status is an enum as follows:

public enum Status
{
    None = 0,
    Active = 1,
    Inactive = 2,
    Deleted = 4
}

I have tried both methods ([DynamicLinqTypeAttribute] and CustomTypeProvider) mentioned in #689 (comment)
to no avail.

How do I call a method on an enum, not a class.

@StefH StefH self-assigned this Jun 10, 2023
@StefH
Copy link
Collaborator

StefH commented Jun 10, 2023

#714

@StefH
Copy link
Collaborator

StefH commented Jun 10, 2023

@DamienLaw
This will be added in next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants