sapiens / SqlFu

Fast and versatile .net core data mapper/micro-orm
Other
229 stars 50 forks source link

Queries wirh enums not handled properly in .Net Framework 4.6 #68

Closed aleq closed 9 years ago

aleq commented 9 years ago
    [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.

sapiens commented 9 years ago

Fixed and released patch.

aleq commented 9 years ago

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 :)

sapiens commented 9 years ago

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.