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

Enhance the ToString method to display the underlying integer for enums instead of the prop name #88

Closed
ahmad-moussawi opened this issue Jun 12, 2018 · 1 comment

Comments

@ahmad-moussawi
Copy link
Contributor

public enum Type {
  A,
  B,
  C,
}

var query = new Query("Table").Where("Type", Type.A);
var sql = compiler.Compile(query).ToString(); 

Current behavior

// SELECT * FROM "Table" WHERE "Type" = 'A'

Expected behavior

// SELECT * FROM "Table" WHERE "Type" = 0
@fairking
Copy link

Is there any way to switch back to the prop names behavior? I know I can always do like that Where("Type", Type.A.ToString()), but my project stores enums as strings, so I never store enums as integers.

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

No branches or pull requests

2 participants