@Breems - Separating models is important. I have domain models in my data access layer which are purely for use with a repository. I have view models which are part of the presentation layer that have subsets of the domain models. I have transport models inside of my service layer for special subqueries.
@RodrigoSilva - A service should request the data, but not actually fire up the db connection and do the query. It can format the data how it pleases from the data access layer and then return that to the presentation layer. That layer can then work with the formatted data and choose another subset to send out to the view.
@TravisJ Hm I see. What type of data should DAL return? In the case of files it might return a bunch of FileInfos, but what if it's custom data? Should I return the Model class representation of it?
Hey guys, I had a question about working with bitmap files that have been loaded in as resources if anyone has experience with it. Specifically, when looking at one at runtime, is there a way to see the resources's name? I'm iterating over some cells which contain bitmaps (e.g. checkBox, errorCross, questionMark).
I'd like to be able to iterate through those cells and check whether the bitmap is the checkBox bitmap, the errorCross bitmap, etc. But all it seems to be able to tell me is that the cell contains a bitmap, not any specific type.
@RodrigoSilva - Usually the DAL will provide hooks so that the data can be manipulated in the DAL and returned in the format that the service requested through an injected projection.
Projection being a fancy word for .Select(expression).
Yes, the DAL will technically be doing the conversion, but the details of the conversion will come from the service.
The DAL should have all the data and know all about it. The service should know nothing about all the data and only know about what it needs to move on.
@ReedCopsey - I forgot to remove that. I got a strange error from the line return Db.Places.Cast<T>().Select(select); if the .Cast<T> wasn't used. It was arguing that Place and T were not the same. Anyway, I tried explicitly setting types in a few places and that was one of them.
Anyone know of a really, really customization control in web-forms to display data out of a database, but it isn't a GridView. Is a Repeater really worth it?