Iterate through a list of data and add it to nested models
Some quick remarks.

Don't pointlessly abbreviate: fContent isn't a clear name, for instance.

i, j and k are okay names for variables in a for-loop, but here they really should have meaningful names.

Avoid adding words like &quot;list&quot; to names of collections. Especially when Documentlist isn't a collection, but the oddly named Documents. A class with a plural name? Which is then initialized by setting the badly named property Attdocument?

I'm assuming that you cannot change the property name f_name?

Are you certain that .Contains(&quot;Maindocument&quot;) will always work? Or should it be case insensitive?

In several places you seem to use string concatenation to create directory paths. Avoid this and instead use Path.Combine().

When you construct the MainDocumentModel, try to keep it succinct. (I have omitted Message = &quot;&quot; since IMHO it seems superfluous: why not simply leave it null?) Same for AttDocumentModel in the else, BTW.
  var mainDocumentModel = new MainDocumentModel
  {
      Status = true,
      MainDoc = new List&lt;FileContent&gt;{ fContent }
  };


I have trouble figuring out what if (!(fileNameBefore.Split(' ')[0] == file.f_name.Split(' ')[0])) is supposed to mean. As a matter of fact, that whole if...else seems to reference some kind of logic that really should be documented there with comments. It doesn't help that we don't have access to the code for GenerateOrderNumberForRis.

There are two places where you do documentOrderNumber + &quot;.pdf&quot;.

Maindocument, Attdocument, ... are compound words and thus should be PascalCase.