News

Entity Framework Core 3.0 Finalized, LINQ Workarounds Published

As with other "Core 3.0" products, Entity Framework is basically done at this point as the big final release is less than two weeks away, and Microsoft has provided some workarounds for the problematic LINQ implementation in the new and final preview.

Microsoft said "We have almost completely stopped making changes to the product code" in announcing EF Core 3.0 Preview 9, but it's seeking feedback on any bugs that developers can find, even if they can't be fixed in time for .NET Core 3.0 shipping during the Sept. 23-25 online .NET Conf event.

Some of those bugs might have to do with LINQ, with which the EF dev team has struggled in the move to .NET Core 3.0.

LINQ (Language Integrated Query) uses C# code to query various types of data stores, providing IntelliSense, strong typing and other benefits in an alternative to SQL queries.

The problematic .NET Core 3.0 porting was explained last month in the release of Preview 8. "The LINQ implementation in EF Core 3.0 is designed to work very differently from the one used in previous versions of EF Core, and in some areas, it's still a work in progress," said program manager Diego Vega in an Aug. 13 announcement post. "For these reasons, you are likely to run into issues with LINQ queries, especially when upgrading existing applications."

With EF Core 3.0 basically finalized, Microsoft last week published some workaround advice:

  • Try a daily build to confirm that you aren't hitting an issue that has already been fixed.
  • Switch to client evaluation explicitly: If your query filters data based on an expression that cannot be translated to SQL, you may need to switch to client evaluation explicitly by inserting a call to either AsEnumerable(), AsAsyncEnumerable(), ToList(), or ToListAsync() in the middle of the query.
  • Use raw SQL queries: If some expression in your LINQ query is not translated correctly (or at all) to SQL, but you know what translation you would want to have generated, you may be able to work around the issue by executing your own SQL statement using the FromSqlRaw() or FromSqlInterpolated() methods.

Along with EF Core 3.0 Preview 9, Microsoft also shipped Entity Framework 6.3 Preview 9, a holdover from the traditional, proprietary, aging and Windows-only.NET Framework that is now an independent offering. As the company explains the difference between the two:

  • Entity Framework 6 (EF6) is a tried and tested object-relational mapper (O/RM) for .NET with many years of feature development and stabilization.
  • Entity Framework (EF) Core is a lightweight, extensible, open source and cross-platform version of the popular Entity Framework data access technology.

Any bugs found can be reported to either the EF Core issue tracker or the EF 6 issue tracker on GitHub.

The EF dev team publishes weekly status updates on its progress on GitHub.

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • Microsoft Revamps Fledgling AutoGen Framework for Agentic AI

    Only at v0.4, Microsoft's AutoGen framework for agentic AI -- the hottest new trend in AI development -- has already undergone a complete revamp, going to an asynchronous, event-driven architecture.

  • IDE Irony: Coding Errors Cause 'Critical' Vulnerability in Visual Studio

    In a larger-than-normal Patch Tuesday, Microsoft warned of a "critical" vulnerability in Visual Studio that should be fixed immediately if automatic patching isn't enabled, ironically caused by coding errors.

  • Building Blazor Applications

    A trio of Blazor experts will conduct a full-day workshop for devs to learn everything about the tech a a March developer conference in Las Vegas keynoted by Microsoft execs and featuring many Microsoft devs.

  • Gradient Boosting Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the gradient boosting regression technique, where the goal is to predict a single numeric value. Compared to existing library implementations of gradient boosting regression, a from-scratch implementation allows much easier customization and integration with other .NET systems.

  • Microsoft Execs to Tackle AI and Cloud in Dev Conference Keynotes

    AI unsurprisingly is all over keynotes that Microsoft execs will helm to kick off the Visual Studio Live! developer conference in Las Vegas, March 10-14, which the company described as "a must-attend event."

Subscribe on YouTube