title: Selected item not return value asp.net MVC
body: <p>I have this model,and table i db with data</p>
  <pre><code>public class FileType
      {
          public int Id { get; set; }
  
          public string FileTypeName { get; set; }
      }
  </code></pre>
  <p>I have upload form and this viewmodel for upload</p>
  <pre><code> public List&lt;FileModel&gt; Files { get; set; }
          public string Name { get; set; }
          public string Extension { get; set; }
          public string Description { get; set; }
          public string Author { get; set; }
          public string Year { get; set; }
          public string FilePath { get; set; }
          public string PublishedOn { get; set; }
          public int DownloadCounter { get; set; }
          public Genres Genre { get; set;}
          public int FileTypeId { get; set; }
          public List&lt;SelectListItem&gt; FtypeList { get; set; }
          public FileType FileT { get; set; }
  </code></pre>
  <p>I generate dropdown list to pick FileType with this code :</p>
  <pre><code> public  IActionResult Index()
          {
              var vm = new FileUploadViewModel();
              vm.FtypeList = context.FileTypes
                  .Select(a =&gt; new SelectListItem()
              {
                  Value = a.Id.ToString(),
                  Text=a.FileTypeName
              }).ToList();
  
              ViewBag.Message = TempData[&quot;Message&quot;];
              return View(vm);
          }
  </code></pre>
  <p>And in view i have this</p>
  <pre><code>&lt;div class=&quot;form-group row&quot;&gt;
          &lt;label asp-for=&quot;FileT&quot; class=&quot;col-sm-2 col-form-label&quot;&gt; &lt;/label&gt;
          &lt;div class=&quot;col-sm-10&quot;&gt;
              &lt;select asp-for=&quot;FileT&quot; class=&quot;custom-select mr-sm-2&quot; asp-items=&quot;@Model.FtypeList&quot;&gt;&lt;/select&gt;
          &lt;/div&gt;
          &lt;/div&gt;
  </code></pre>
  <p>In the HttpPost action i do this</p>
  <pre><code>[HttpPost]
          public async Task&lt;IActionResult&gt; Index(List&lt;IFormFile&gt; files, string description,DateTime PublishedOn,string Author,string Name,FileType Ftype)
          {
              foreach (var file in files)
              {
                  var basePath = Path.Combine(Directory.GetCurrentDirectory() + &quot;\\Files\\&quot;);
                  bool basePathExists = System.IO.Directory.Exists(basePath);
                  if (!basePathExists) Directory.CreateDirectory(basePath);
                  var fileName = Path.GetFileNameWithoutExtension(file.FileName);
                  var filePath = Path.Combine(basePath, file.FileName);
                  var extension = Path.GetExtension(file.FileName);
                 
                  DateTime dateTime = DateTime.UtcNow;
                  var createdOn = dateTime.ToShortDateString();
                  if (!System.IO.File.Exists(filePath))
                  {
                      using (var stream = new FileStream(filePath, FileMode.Create))
                      {
                          await file.CopyToAsync(stream);
                      }
                      var fileModel = new FileModel
                      {
                          Year =createdOn,
                          PublishedOn = PublishedOn.ToShortDateString(),
                          FileType = file.ContentType,
                          Extension = extension,
                          Name = Name,
                          Description = description,
                          FilePath = filePath,
                          Author=Author,
                          Ftype=Ftype,
                      };
                      context.Files.Add(fileModel);
                      context.SaveChanges();
                  }
              }
              TempData[&quot;Message&quot;] = &quot;File successfully uploaded to File System.&quot;;
              return RedirectToAction(&quot;Index&quot;,&quot;Home&quot;);
          } 
  </code></pre>
  <p>But when i upload file it doesnt get the selected value from dropdown list it create new item in the selected list.For example i have only 4 FileTypes in table if i select item with value=3 when file is uploaded to db in the table with uploaded files Ftype = 5 and it create new row in FileTypes table with Id = 5.</p>