Yes rogue repositories is a very real thing. Especially in this example where I am using Linq. Newer developers can often make very costly mistakes using Linq with EF. How have you seen sprocs used in a repository pattern? Is there a good rule of thumb there?
The most effective way I've used it was in Oracle where I could use schemas and packages to categorize the data repositories. The method I used was to require the procedure or view results match the associated interface. The calls in the backend code were similar to what Sam illustrated above, with some additional checking to insure valid objects were being returned.
As with everything, unit testing of these calls was essential, including checking the time to insure the queries were efficient.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Yes rogue repositories is a very real thing. Especially in this example where I am using Linq. Newer developers can often make very costly mistakes using Linq with EF. How have you seen sprocs used in a repository pattern? Is there a good rule of thumb there?
The most effective way I've used it was in Oracle where I could use schemas and packages to categorize the data repositories. The method I used was to require the procedure or view results match the associated interface. The calls in the backend code were similar to what Sam illustrated above, with some additional checking to insure valid objects were being returned.
As with everything, unit testing of these calls was essential, including checking the time to insure the queries were efficient.