I would use the following template as it allows you to switch to a different saving strategy later.
UI/Consumer <--- (view models) --> BLL <--- Models ----> DAL/Persistence
Here, View models are consumed outside of the BLL, and models are transferred through the BLL / DAL layers.
In your case, the model may be what uses DAL - DataTables, for example, or perhaps ORM objects. BLL is responsible for matching the model and the presentation model.
As for the preservation of types in their own assemblies - yes for view models and to maintain consistency, and for models.
Saving models and viewing models limits the leakage of conservation strategies outside of the BLL and thus allows future design changes to be consistent.
One of the advantages of this separation is that consumers of different models can have different viewing models for the same stability model / object. Some of them can be small and have several attributes, while others are large and rich in functionality. It also allows you to enter offline / offline features, as view models can be returned at different points in time, which allows you to decide data merging strategies. It also allows you to create resilience objects (like tables for growth and shape change). Since it looks like a .net implementation such as AutoMapper , you get a lot of functionality out of the box
Of course, this may be too redundant for your application, but I still support BLL mapping, which will only consider viewing models for all BLL consumers. This should give you enough denouement.
Preet sangha
source share