Access to Entity framework operations (disucssion)

Issue #256 closed
Brian Lewis repo owner created an issue

With EF in place, some of the simpler data access operations can potentially be handled by standard Linq operations on EF entity sets. Operations returning objects as complex as School ( which comes with all its related data) are probably best handled by the current approach - call a stored procedure to return multiple record sets, then manipulate those recordsets into a hierarchical object (using StructuredResult) Similarly, complex stored procs for filtering will not lend themselves to EF formats (particularly when the shape of the recordset returned by such procedures may vary.

However, a single, simple read of an entity may efficiently use EF Linq and therefore avoid the need to add a new method to the datalayer interface.

So facilitate this I propose to make Context a public method of IDSFactory - so that every API controller ( and as of issue #253 every Mvc controller) will have access to Context.

This is a pretty major change that could have a substantial impact on the code base - we will have to be mindful of maintaining "separation of concerns" with this feature in place. We would not want to see large sequences of data-centric operations migrate into the controller layer - at a certain point, an operation should be treated as significant enough to warrant its own DataLayer method.

Comments (1)

  1. Log in to comment