Passing an HttpFileCollectionBase to a business layer - bad?

hope this is a simple solution.

I have an MVC2 project that allows you to upload files to specific forms. I try to have my controllers lean on and handle the processing in this kind of business layer.

However, the HttpFileCollectionBase is obviously in the System.Web assembly.

Ideally, I want to call something like:

UserService.SaveEvidenceFiles(MyUser user, HttpFileCollectionBase files);

or something like that, and my business layer handles the logic of how and where these things are stored.

But it seems a little bad for my model layer to refer to System.Web in terms of separation of concerns, etc.

So, we have (what I know) several options:

  • web project handling this and my controllers get thicker
  • mapping HttpFileCollectionBase to what my business layer likes
  • , System.Web -

- , - .

+3
2
+2

, HttpFileCollectionBase, - Dictionary < String, MyFile > MyFile HttpPostedFile. HttpFileCollectionBase , .

0

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


All Articles