repository pattern - Updating a Model in asp.net mvc -


Our project manager has asked us to refact an app that was using the repository pattern (for example Nerddinner was used) NOW use one now my problem is that I am not sure how to update the model because UpdateModel method is supposed to be used in controller ... Repository with service level A mod using patterns What is the recommended approach to update ?? Please help

I would suggest that you want to hide your current repository pattern within your service repository . Data access codes should not be visible to service customers.

You can apply the collection of DTO which will be returned from service level or accepted as a parameter. Those items can be POCOs only to keep data in database-anecdotal way.

DTO usually deals with the adapter for your data access classes (which represent tables) / for translation. This approach allows you to change the database schema without changing the service level interface.

You can consider those DTOs as models in MVC, if your project is simple and the data service level matches your DTO for your ideas. You can also define your model in MVC project and allow the second set of controller or editor to translate the models into DTO.

My favorite design model is also included in the MVC (model folder) that works with strongly typed scenes. UpdateModel method then works with those sections. The next controller or ModelAdapter service layer creates an example of DTO and sends them to the services. Within the services, DTO adapters are then responsible for populating the data access category from the repository pattern.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -