Question

This is more of an architectural question regarding MVC and Data Access:

We have a custom program that generates all the stored procs and classes for the Data Tier from the MS SQL database. It's pretty nice as it generates a base class with the basic CRUD operations which includes ForeignKey reads. It also generates the plural version of the class to return the collections of objects.

For the next phase of our application we are planning on using MVC but we were hoping to continue using this great tool. Where will I put the generated classes in my new MVC application? I have seen people create an Infrastructure folder for their data access logic.

Is it a good idea to continue using this tool or should we be converting to the Entity Framework?

Also if the DAL is returning my objects and lists of objects what will I put in my Model layer?

Was it helpful?

Solution

You could put those classes in a separate DAL assembly that will perform the actual data access.

Is it a good idea to continue using this tool or should we be converting to the Entity Framework?

Something that's proven to work in the past is not something that you would replace like that for a hype word.

Also if the DAL is returning my objects and lists of objects what will I put in my Model layer?

Your view models. The classes you will actually be passing to your views. Basically your controllers will be querying your DAL layer retrieving the autogenerated classes and then they will be mapping them to view models that will be passed to the views.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top