0

My MVC project accesses data using ADO.NET stored procedures. Most data that is returned requires a lot of formatting and much of it is used for business logic only and not displayed in a View. Currently we map it to classes in a folder called "Entities". The View Model needs to display the formatted values from multiple Entities.

I want to be able to take the data from the entity object(s), perform business logic and write it to the appropriate Model. Where do I write all this business logic?

Current Folder Structure:

Entities (where the classes reside that match the database fields)

Repositories (where I call the stored procedures and map the results to the appropriate entities)

Models (The ideal structure and field names to be used by a View)

Views

Controllers

4

1 回答 1

1

Although there are no concrete rules for business logic regarding .NET MVC, your business logic generally goes in the Model.

Fat models and skinny controllers are generally a good rule of thumb.

于 2013-03-29T22:41:14.030 回答