Relative Content

Tag Archive for constructors

C# Constructor and private LINQ to SQL members

I am extending an application I have developed so that it is more broadly useful for multiple jobs, rather than the single job I created it for. There are a number of tables that I get from SQL Server with LINQ to SQL. Instead of having all records from the database populate the application, I want to filter first by job. Currently my viewmodels all have the same construction: a set of private ObservableCollections that get the data through the LINQ to SQL classes, a constructor that sets up binding commands (trying to practice good MVVM), and then the logic. So what I do now is something like this:

C# Constructor and private LINQ to SQL members

I am extending an application I have developed so that it is more broadly useful for multiple jobs, rather than the single job I created it for. There are a number of tables that I get from SQL Server with LINQ to SQL. Instead of having all records from the database populate the application, I want to filter first by job. Currently my viewmodels all have the same construction: a set of private ObservableCollections that get the data through the LINQ to SQL classes, a constructor that sets up binding commands (trying to practice good MVVM), and then the logic. So what I do now is something like this:

C# Constructor and private LINQ to SQL members

I am extending an application I have developed so that it is more broadly useful for multiple jobs, rather than the single job I created it for. There are a number of tables that I get from SQL Server with LINQ to SQL. Instead of having all records from the database populate the application, I want to filter first by job. Currently my viewmodels all have the same construction: a set of private ObservableCollections that get the data through the LINQ to SQL classes, a constructor that sets up binding commands (trying to practice good MVVM), and then the logic. So what I do now is something like this:

C# Constructor and private LINQ to SQL members

I am extending an application I have developed so that it is more broadly useful for multiple jobs, rather than the single job I created it for. There are a number of tables that I get from SQL Server with LINQ to SQL. Instead of having all records from the database populate the application, I want to filter first by job. Currently my viewmodels all have the same construction: a set of private ObservableCollections that get the data through the LINQ to SQL classes, a constructor that sets up binding commands (trying to practice good MVVM), and then the logic. So what I do now is something like this: