4
May

Entity Framework v4 and Firebird – moving forward

As it may look like nothing is going on, it’s not true. Next to Firebird 2.5 new protocol features, I’m also working on Entity Framework v4 support. Before I go further, be sure, that all providers written for Entity Framework v1 are also working with v4.

In fact right now all the major improvements in Entity Framework v4 are supported. You can benefit from features available, like the LIKE translation support or plenty of new functions. My personal favorite is TruncateTime (so I can get rid of workaround). The Model First approach is next in a row. At least basic T4 template for start is my aim. The rest could be done by you, simply modifying the template. And also wiring the template into code so you can use it programmatically too. Under the cover, while working on new stuff I’m also finding ways to optimize the code. Luckily the changes will be noticeable. ;)

The DDEX for Firebird supports Visual Studio 2010 and the full Entity Framework v4 support will be here soon – now you can try a weekly build. Feel free to ask about anything related.

There's 8 Comments So Far

  • Jorge Alvarez
    May 6th, 2010 at 16:27

    Excellent, great news indeed!

    My company has been using Firebird since 1.0 and today .NET / EF support is a must for me, and it is for every Firebird / .NET developer this days as well. Personally, I think .NET/EF support is essential for Firebird success and user base increase.

    Thanks Jiri, you are the man! :) Please keep up the good work.

  • Marco Castro
    May 9th, 2010 at 03:47

    Hi Jiri,

    Congratulations for the good job you are doing. I’m following this project for a long time and I already have 280 tables in a entity framework.

    But some time I get issues that I would like to share with you. The FireBird that I use is 2.5.

    Look at this Linq

    from c in CLIENTS
    where c.INVOICES.All(n => n.DATE > DateFrom && n.DATE @p__linq__0) AND (“Extent3″.”DATE” @p__linq__0) AND (“Extent3″.”DATE” @p__linq__0) AND (“Extent3″.”DATE” < @p__linq__1))) THEN CAST(0 AS SMALLINT) END IS NULL))
    ))

    This query brings only data for CITYID = 1. If I insert in Where clause "&& c.CITYID != 1", all cities but 1 are brought.

    If I change in the SQL statement INNER to LEFT OUTER the query works correctly.

    Thanks,
    Marco Castro

  • Marco Castro
    May 9th, 2010 at 03:59

    Ops, the examples was exported wrongly to the blog. Here are them:

    from c in CLIENTS
    where c.INVOICES.All(n => n.DATAEMISSAO > DateFrom && n.DATE < DateTo)
    select new { c.CLIENT_NAME, c.PHONE, c.CITY_ID, c.CITIES.NAME };

    SELECT
    “Extent1″.”CLIENT_ID” AS “CLIENT_ID”,
    “Extent1″.”CLIENT_NAME” AS “CLIENT_NAME”,
    “Extent1″.”PHONE” AS “PHONE”,
    “Extent1″.”CITY_ID” AS “CITY_ID”,
    “Extent2″.”NAME” AS “NAME”
    FROM “CLIENTS” AS “Extent1″
    INNER JOIN “CITIES” AS “Extent2″ ON “Extent1″.”CITY_ID” = “Extent2″.”CIDADE”
    WHERE NOT EXISTS (SELECT
    1 AS “C1″
    FROM “NOTASSAIDA” AS “Extent3″
    WHERE (“Extent1″.”CLIENT_ID” = “Extent3″.”CLIENT_ID”) AND (( NOT ((“Extent3″.”DATE” > @p__linq__0) AND (“Extent3″.”DATE” < @p__linq__1)))
    OR (CASE WHEN ((“Extent3″.”DATE” > @p__linq__0) AND (“Extent3″.”DATE” < @p__linq__1)) THEN CAST(1 AS SMALLINT)
    WHEN ( NOT ((“Extent3″.”DATE” > @p__linq__0) AND (“Extent3″.”DATE” < @p__linq__1))) THEN CAST(0 AS SMALLINT) END IS NULL))
    )

  • cincura.net
    May 9th, 2010 at 18:54

    The shape of query strongly depends on shape of model. I recommend you join the netprovider list [http://firebirdsql.org/index.php?op=lists] and discuss it there, as here’s limited space to do it.

  • gabriel
    January 25th, 2011 at 16:48

    please, one question. is there any SSDLToFirebird T4 Script? If the answer is that yes, please, where i found it? thanks. Sorry my english.

  • cincura.net
    January 25th, 2011 at 17:15

    Yes, it’s in \trunk\NETProvider\source\FirebirdSql\Data\Entity\SSDLToFB.tt .

  • Fred
    April 2nd, 2011 at 10:16

    “Luckily the changes will be noticeable.”

    Hehe. There is nothing worse than spending tons of time optimizing code and modding structures and arrays, just to have the user not see any visible changes. The version numbering may change, but the user just is not aware (and cannot appreciate) all the hard work… Sigh…

Who Linked To This Post?

  1. Firebird News » Entity Framework v4 and Firebird

Share your thoughts, leave a comment!