Do you want to move all business logic to the BLL level, but you need to pass it to formcollection, is it clean?

In my control parameter, asp.net takes a FormCollection parameter.

Then I look through my own collection, look through the value collection in the form collection, etc.

I have moved all of my code to my business logic level and will simply name my business logic level in my action, for example:

SomeManager.Update(formCollection);

But I feel a little tired getting into shape at my business level.

Do I really have a choice here? any other ideas?

or is it beautiful?

+3
source share
4 answers

- - , - ; - , ASP.NET MVC, WPF, WCF, EF, NHibernate -.

, POCOs ( CLR), , , FormCollections ASP.NET MVC.

, Update , .

, FormCollection , . Mapper. mapper, AutoMapper .

+8

, System.Web.XXX - . , FormCollection.

. .

+3

why not create some kind of dto (data transfer object), and then fill in and then pass this through. it will be a little cleaner.

0
source

I would create a mapper class that takes a FormCollection and returns an instance or an updated instance of the class.

ManagerMapper.Create (FormCollection) or ManagerMapper.Update (SomeManager, formcollection)

0
source

Source: https://habr.com/ru/post/1726741/


All Articles