1
Guys, I’m developing an application that manages enrolment courses, on my screen of listing the courses is like this:

Only I need to make a new screen with another type of listing, and I would like the listing to be by course and show the students enrolled in this course. For example, the screen would have to be like this:

Can someone help me?
Model Aluno
public class Aluno
{
    [Key]
    public int Id { get; set; }
    [Required(ErrorMessage = "O campo Nome é obrigatório")]
    [MinLength(4, ErrorMessage = "O campo Nome deve ter no mínimo 4 caracteres")]
    [Display(Name = "Nome")]
    public string Nome { get; set; }
    [Display(Name = "CPF")]
    [Required(ErrorMessage = "O campo CPF é obrigatório")]
    [Index(IsUnique = true)]
    [CPFAtributo]
    public string CPF { get; set; }
    [Display(Name = "RG")]
    public string RG { get; set; }
    [Display(Name = "E-mail")]
    [Required(ErrorMessage = "O campo E-mail é obrigatório")]
    [RegularExpression(@"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*", ErrorMessage = "Endereço de e-mail informado não é válido.")]
    public string Email { get; set; }
    [Display(Name = "Usuário")]
    [MinLength(4, ErrorMessage = "O campo Usuário deve ter no mínimo 4 caracteres")]
    [Required(ErrorMessage = "O campo Usuário é obrigatório")]
    public string Usuario { get; set; }
    [Display(Name = "Senha")]
    [Required(ErrorMessage = "O campo Senha é obrigatório")]
    public string Senha { get; set; }
    [Display(Name = "Confirmar Senha")]
    [Compare("Senha", ErrorMessage = "As senhas não conferem")]
    public string ConfirmaSenha { get; set; }
    [Display(Name = "Telefone Celular")]
    [Required(ErrorMessage = "Informe um número de Celular")]
    public string Telefone_Celular { get; set; }
    [Display(Name = "Telefone Fixo")]
    public string Telefone_Fixo { get; set; }
    [Display(Name = "Endereço")]
    [Required(ErrorMessage = "O Endereço é obrigatório")]
    public string Endereco { get; set; }
    [Display(Name = "Estado")]
    [Required(ErrorMessage = "Informe um Estado")]
    public string Estado { get; set; }
    [Display(Name = "Complemento")]
    public string Complemento { get; set; }
    [Display(Name = "Matrícula")]
    [Required(ErrorMessage = "Informe a Matrícula")]
    public string Matricula { get; set; }
    [Display(Name = "Cargo Efetivo")]
    public string Cargo_Efetivo { get; set; }
    [Display(Name = "Cargo Comissionado")]
    public string Cargo_Comissionado { get; set; }
    [Display(Name = "Telefone Orgao")]
    public string Telefone_Orgao { get; set; }
    [Display(Name = "Nome Chefe Imediato")]
    public string Nome_Chefia_Imediato { get; set; }
    [Display(Name = "Telefone Chefe Imediato")]
    public string Telefone_Chefia_Imediato { get; set; }
    public string Perfil { get; set; }
    public ICollection<Curso> Cursos { get; set; }
Model Curso
public class Curso
{
    [Key]
    public int Id { get; set; }
    [Display(Name = "Curso")]
    [Required(ErrorMessage = "O campo Curso é obrigatório")]
    public string Nome_Curso { get; set; }
    [Display(Name = "Sigla")]
    public string Sigla { get; set; }
    [Display(Name = "Ementa")]
    [Required(ErrorMessage = "A Ementa é obrigatório")]
    public string Ementa { get; set; }
    [Display(Name = "Aprovado")]
    public bool Aprovado { get; set; }
    [DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]
    [DataType(DataType.Date)]
    [Display(Name = "Data de Início")]
    public DateTime Dt_Inicio { get; set; }
    [DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]
    [DataType(DataType.Date)]
    [Display(Name = "Data Final")]
    public DateTime Dt_Fim { get; set; }
    [Display(Name = "Turno")]
    [Required(ErrorMessage = "Informe um Turno")]
    public string Turno { get; set; }
    public string Status { get; set; }
    [Display(Name = "Quantidade de Vagas")]
    [Required(ErrorMessage = "A quantidade de Vagas é obrigatório")]
    public int Qtd_Vagas { get; set; }
    public int AlunoId { get; set; }
    public Aluno Aluno { get; set; }
Query code as first image above
public ActionResult MeusCursos()
    {
        var cursos = db.Cursos.Include(a => a.Aluno).ToList();
        return View(cursos);
    }
If possible, post the structure of your tables along with the code you are using to perform the query.
– Randrade
I edited the question @Randrade these are my tables.
– Novato