I already have an Entity Framework, as well as a repository and some static classes / methods for managing data. Here is a typical example:
public static IEnumerable<Supplier> Contains(IEnumerable<int> idList) { return SupplierView.Select().Where(x => idList.Contains(x.ID)); }
These methods request my EF repository, and sometimes I need to pass in a few variables to get the data I need.
Given that my provider object already exists, I am considering creating methods to extend queries using a class, something like this:
public static IEnumerable<Supplier> GetSimilar(this Supplier s) { return SupplierView.Select().Where()); }
It will be used only for data queries, but since I base the extension method on the whole, I'm not sure if this is a great design idea, but it is certainly more convenient that passing parameters / checking them, etc.
I already have a partial class created for my main objects, but I tend to add properties, low impact properties.
Any thoughts?
source share