A combination of different classes of models?

Recently, I accidentally moved from the world of a data set to a common world. I am a little confused in some models.

In my model, I had three types of models like Product {Productid, ProductName}, ProductType {ProductTypeId, ProductTypeName}, ProductCategory {ProductCategoryId, ProductCategorName}

My stored procedure returns {ProductName, ProdcutTypeName, ProductCategoryName}

I used to use Dataset :). But I am worried that how to keep these combinations in the list. Can't I take a list or whatever? Do I need to create a separate class for this?

Can someone suggest me how to deal with these situations?

+4
source share
2 answers

Yes

You must create new models for all combinations that return stored procedures.

If you start from scratch with, say, the Entity Framework Code First, you are likely to define a couple of models that will satisfy most of your needs and target your own stored procedures (which is likely to be much less) for those predictions.

But now that you are working on an existing database, your world will be a bit uncomfortable. And something that can burn you up is stored procedures, which if / else return different result sets. Link frowned. I learned this hard way.

0
source

I would suggest you create a new class. Configure ALl 3 objects from previous classes .. this will help you

0
source

All Articles