General information
Category:
Coding, syntax and commands
>I have created a class called DataAccess. It's in its own project in the solution. It contains a static reference to my SqlDataAccess class. Right now I have a method in it called GetCompanies() that returns a dataset containing one or more companies.
>
>In the GetCompanies method I was considering populating a generic list containing instances of the Company class and returning that to the UI layer, instead of returning a dataset.
>
>Anyone think there's any benefit to this? Pro's Cons?
Hi,
I guess it depends on what you will be doing with this in the UI. My intuition would say have the SQLDataAccess class return a Dataset to the DataAccess layer but have methods there that either simply pass on the Dataset or convert to different representations (e.g the list of Complany classes) as required.
I'm working with the EF so everything I get from the DB is already an object by the time I get my hands on it so......
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only