So I have a Winforms program that is set up such that There is a single form with a datagridview that is responsible for displaying Litigation Matters. A matter is just a class that contains an ID, Description, some Dates, and then some Collections (Navigation properties) eg:
public int MatterID
public string Description
public DateTime? DateFiled
public ICollection<Contact> Plaintiffs
public ICollection<Contact> Attorneys
Now here is where the problem starts:
The user can view different sets of Matters; All Matters, Open Matters, Closed Matters, Searched Matters (based on search criteria), Matters associated with a given contact, etc (many more)
This MatterViewer form has a datagridview that is responsible for displaying the matters and refreshing the data as things get updated. (eg. A user could right click on a Matter in the datagridview and edit it, then the Matters in the Datagridview need to be refreshed).
In order for this to work, I currently have form constructors that take in a querystring so that I have access to the query that was used to obtain these specific matters and use it to refresh the specific data as needed:
public FormViewMatters(string matterQueryString, string dataSetName = null)
{
//Code here
}
If I were to pass in just a list of Matters to the Form, then I would only ever be able to refresh items in that list, not refresh the all potential matters based on the query.
Using the querystring however, limits me to lazy loading navigation properties. I currently need to eager load some of the properties and I am unable to do so.
So what is the best approach to go about refreshing specific data in general (including navigation properties)?
>` is a good option which you can simply use with multiple search methods (queries).
– Reza Aghaei Aug 09 '16 at 14:27