私の最初の質問で私はよく説明しませんでした。しかし今は、エンティティフレームワーククラスからいくつかの列を選択する必要があります。エンティティフレームワークで複数の列を選択する方法は?
var Muestra = Cecytec.asignatura.Select(Z => new asignatura { nombre = Z.nombre, horasPorSemana = Z.horasPorSemana, nivel = Z.nivel, unidades = Z.unidades }).ToList();
私のクラス(表) "asignatura" 私は、この持っているから:
public partial class asignatura
{
public asignatura()
{
this.criterioevaluacion = new HashSet<criterioevaluacion>();
this.evaluacion = new HashSet<evaluacion>();
this.examen = new HashSet<examen>();
this.alumno = new HashSet<alumno>();
this.horario = new HashSet<horario>();
this.profesor = new HashSet<profesor>();
}
public int idAsignatura { get; set; }
public Nullable<int> horasPorSemana { get; set; }
public string nombre { get; set; }
public Nullable<int> nivel { get; set; }
public Nullable<int> unidades { get; set; }
public int semestres_idsemestres { get; set; }
public virtual semestres semestres { get; set; }
public virtual ICollection<criterioevaluacion> criterioevaluacion { get; set; }
public virtual ICollection<evaluacion> evaluacion { get; set; }
public virtual ICollection<examen> examen { get; set; }
public virtual ICollection<alumno> alumno { get; set; }
public virtual ICollection<horario> horario { get; set; }
public virtual ICollection<profesor> profesor { get; set; }
}
をそして私が表示したい: 'ノンブル'、 'horasPorSemana'、 'ニベル'、 'unidades' と ' calificacion」
注: 『calificacion』は、あなたのデータからエンティティに突き出ている別のクラスあなたの投影で
public partial class evaluacion
{
public int unidad { get; set; }
public Nullable<double> calificacion { get; set; }
public Nullable<int> inasistencia { get; set; }
public string observaciones { get; set; }
public int asignatura_idAsignatura { get; set; }
public virtual asignatura asignatura { get; set; }
}
OMG! 2番目の作品!あなたはStackoverflowからMrさんありがとうございます –