I have this 2 models
public class FileType
{
public int Id { get; set; }
public string Name { get; set; }
}
public class Genre
{
public int Id { get; set; }
public string Name { get; set; }
[ForeignKey("FileType")]
public int FileTypeID { get; set; }
}
And tables with data in PostgreSQL database for these models, i want to create 2 dropdownlists in view with Name for filetype and name for genre.I want to create that 2 ddl in this upload view
public class FileUploadViewModel
{
public List<FileModel> 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; }
}
See Question&Answers more detail:os