sapiens/SqlFu

Queries wirh enums not handled properly in .Net Framework 4.6

Closed this issue · 3 comments

aleq commented
    [TestMethod]
    public void enum_handling()
    {
        _sb = new StringBuilder();
        _pm = new ParametersManager();
        _w = new ExpressionWriter(_sb, new SqlServerBuilderHelper(), _pm);

        System.Linq.Expressions.Expression<Func<PostViewModel, bool>> data = p => p.Type == PostType.Page;
        _w.Write(data);
        Assert.AreEqual("([Type] = 1)", _sb.ToString());
    }

The enum value is translated into string rather than number, so it ends up producing invalid SQL statement.

Fixed and released patch.

aleq commented

Thanks for the prompt reaction. Any rough idea when ver 3.0 will be released? I'm very keen to see the progress of this micro-orm :)

I don't know. I'm planning for a public beta though as soon as possible. Just to know, ver 3.0 is a complete rewrite of SqlFu so it isn't backwards compatible.