Generic Data Access Object
-
In MVC , we create a business object that represents a table fields may be with the same column names or with other names then create public properties to get and set those values . that is totally fine until now . then i want to display that Object in a grid , i will assign the datasource property to a ILIST,Ienumerable,IDataSource object like for example List< of One business objects > then the grid will iterate through the collection of objects getting every object and accessing the properties names that will reflect the column names in the grid , and the values of those properties will be assigned to the column values in the grid like for example // we have this business object public class Customer { string FName; string LName; public string FirstName { get { return this.FName;} set { this.FName = value;} } public string LastName { get { return this.LName;} set { this.LName = value;} } } now to display that class to the grid i will put it into a list for example then the grid will iterate through the list , reading each object public properties to draw the column names the grid will have the same column names like the public properties then accessing these properties values to display it to the grid . i need to make a business object to be displayed in the grid but the problem is that the business object in my task doesn't have public properties , the public properties are replaced with a data structure that reads the table schema , "Generic Business Object" that is modifiable according to the table schema inside the data base but finally i need to display each Generic Object to the data source controls like grid
Human knowledge belongs to the world.
-
In MVC , we create a business object that represents a table fields may be with the same column names or with other names then create public properties to get and set those values . that is totally fine until now . then i want to display that Object in a grid , i will assign the datasource property to a ILIST,Ienumerable,IDataSource object like for example List< of One business objects > then the grid will iterate through the collection of objects getting every object and accessing the properties names that will reflect the column names in the grid , and the values of those properties will be assigned to the column values in the grid like for example // we have this business object public class Customer { string FName; string LName; public string FirstName { get { return this.FName;} set { this.FName = value;} } public string LastName { get { return this.LName;} set { this.LName = value;} } } now to display that class to the grid i will put it into a list for example then the grid will iterate through the list , reading each object public properties to draw the column names the grid will have the same column names like the public properties then accessing these properties values to display it to the grid . i need to make a business object to be displayed in the grid but the problem is that the business object in my task doesn't have public properties , the public properties are replaced with a data structure that reads the table schema , "Generic Business Object" that is modifiable according to the table schema inside the data base but finally i need to display each Generic Object to the data source controls like grid
Human knowledge belongs to the world.