The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

LINQ and LINQ to SQL

Last post 05-12-2008, 4:45 AM by Mike.Griffin. 3 replies.
Sort Posts: Previous Next
  •  07-30-2007, 8:02 PM 4190

    LINQ and LINQ to SQL

    Hi Guys,

    A few of us might be asking themselves this question:

    "What does ES bring to the table now that we have Go Live License for LINQ and LINQ to SQL?"

    I know this might be a bit confronting but I'm asking in a good natured way and just wanted to see what the future holds for ES...

    Cheers

  •  08-01-2007, 7:15 AM 4245 in reply to 4190

    Re: LINQ and LINQ to SQL

    No offense taken. We always have at least one eye on emerging technologies, and ask those questions of ourselves to make sure we remain relevant. We see our relationship with Microsoft as more symbiotic than competitive. If we are agile enough, and have the foresight to incorporate the best of Microsoft's offerings, we feel we can continue to deliver on our promise of significantly reduced development costs.

    EntitySpaces users have been able to leverage in LINQ for quite some time now.

    http://www.entityspaces.net/blog/2006/06/18/EntitySpacesAndLINQAnIntroductionPart1.aspx

    But, the date on that post reveals one area where we feel we have an advantage. Microsoft's vision takes months to come to fruition, and often evolves significantly along the way. LINQ to SQL looks particularly interesting, but VS 2008 and .NET Framework 3.5 are still in Beta. EntitySpaces Developer is shipping now, and as an architecture, delivers some things that still need to be fleshed out with them, supporting multiple back-end database vendors, generating WebServices proxy/stub classes, generating ASPX Admin grids, not to mention all the little niceties like wrapping hierarchical saves in a transaction, bringing back identity keys and computed columns, built-in INotifyPropertyChanged support on generated properties, etc.

    Our goal is to give customers the best of both worlds as those, and other technologies like REST/POX, Windows Communication Foundation, Windows Presentation Foundation, Silverlight, and so on become more mainstream. Microsoft understands that products like EntitySpaces makes their products even more efficient and easier to use. We just need to make sure we remain in the position of further increasing developer productivity, no matter what comes down the pike. Cool


    David Neal Parsons
    www.entityspaces.net
  •  04-13-2008, 3:19 PM 8836 in reply to 4245

    Re: LINQ and LINQ to SQL

    See our latest blog POST

    Also, there will be more coming up on this, such as ....

     

    Code:
    public Form1()
    {
    InitializeComponent();

    dataContext = new DataContext("User ID=sa;password=griffinski;Initial Catalog=ForeignKeyTest;Data Source=GRIFFO;");

    Test_LINQ();

    long start = System.Environment.TickCount;
    for (int i = 0; i < 1000; i++)
    {
    Test_LINQ();
    }
    long end = System.Environment.TickCount;

    long time = (end - start);
    }

    void Test_LINQ()
    {
    var employees = dataContext.GetTable();
    var query = from employee in employees where employee.Age < 50 && employee.Age > 10 select employee;

    foreach (Employee emp in query)
    {

    }
    }
     

    This is some test code I ran but didn't yet publish. Both Test_LINQ() and Test_EntitySpaces() are returning the same EntitySpaces classes from the same table using the same connection string. I call each once to avoid any first time loading issues before the tests begin.

    The SQL generated by Test_LINQ() is as follows:

     

    Code:
    SELECT [t0].[EmployeeID], [t0].[LastName], [t0].[FirstName], [t0].[Age], [t0].[Supervisor]
    FROM [Employee] AS [t0]
    WHERE ([t0].[Age] < @p0) AND ([t0].[Age] > @p1
     

    The first three times for Test_LINQ() were as follows (milliseconds)  2484, 2734, 2578

     

    Now, I changed the calls to Test_LINQ() to Test_EntitySpaces() which looks like this:

     

    Code:
    void Test_EntitySpaces()
    {
    EmployeeCollection coll = new EmployeeCollection();
    coll.Query.Where(coll.Query.Age < 50 & coll.Query.Age > 10);
    coll.Query.Load();

    foreach (Employee emp in coll)
    {

    }
    }
     

    The SQL generated by Test_EntitySpaces is as follows:

     

    Code:
    SELECT * 
    FROM [Employee]
    WHERE ([Age] < @Age1 AND [Age] > @Age2)
     

    The first three times for Test_EntitySpaces() were as follows (milliseconds)  375, 375, 391

    Of course, our EntitySpaces API works on .NET 2.0 and up, mono, the Compact Framework, Medium Trust, and requires zero reflection. Also, it runs on Microsoft SQL, Oracle, MySQL, PostgreSQL, VistaDB, Microsoft Access, and Microsoft SQL CE now ...


     


    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  05-12-2008, 4:45 AM 9255 in reply to 8836

    Re: LINQ and LINQ to SQL

    We now have LINQ to SQL support, see our latest two blog posts, Part 1 & 2

    EntitySpaces | Twitter | BLOG | Please honor our Software License
View as RSS news feed in XML