title: Save multiple images to database using IFormFile asp.net core 3
body: <p>Images not saved in the database but it is shown when I debug the code why (.Add) object not working</p>
  <pre class="lang-cs prettyprint-override"><code>if (ModelState.IsValid)
  {
      // there is Code here
  
      var imageList = new List&lt;AdsImg&gt;();
      foreach (IFormFile photoIform in userInfoModelView.Photo)
      {
          if (photoIform.Length &gt; 0)
          {
              var stream = photoIform.OpenReadStream();
              var img = Image.FromStream(stream);
              img.ScaleAndCrop(273, 162)
              .SaveAs($&quot;wwwroot\\upload\\{photoIform.FileName}&quot;);
              var img2 = new AdsImg
              {
                  AdId = ad.Id,
                  ImgPath = photoIform.FileName,
  
              };
              imageList.Add(img2);
          }
          
      }
  }
  </code></pre>