Skip to content

Different Behavior than I expected #91

Description

@danielscatigno-ncpc

Hi this is more like a question, I have not found the answer anywhere

I'm trying to convert an Expression to string
1)

Expression<Func<ProjetoProcessamentoViewModel,bool>> exp = x=>x.IdProjeto==3;
exp.ToString(BuiltinRenderer.DynamicLinq,"C#");

The output is
""IdProjeto == 3""

And ok That is what I expected
but when I convert the value into a variable:
2)

int IdProjeto=3;

Expression<Func<ProjetoProcessamentoViewModel,bool>> exp = x=>x.IdProjeto==IdProjeto;
exp.ToString(BuiltinRenderer.DynamicLinq,"C#");

the output is:
"// @0 = IdProjeto\r\n\r\n"IdProjeto == @0""

Is there any way that the variable be converted to its value so the output is the same as example 1?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions