Ho to everybody. Below you can see the partial result of the EF Power Tools reverse engineering made on the database of mine.
public partial class Articoli {
public decimal Id_Articolo { get; set; }
public string Codice { get; set; }
public virtual ICollection<Udc_Dettaglio> FK_Udc_Dettaglio_Articoli { get; set; }
}
public partial class Udc_Dettaglio {
public decimal Id_Udc { get; set; }
public decimal Id_Articolo { get; set; }
public virtual Articoli FK_Udc_Dettaglio_Articoli { get; set; }
}
public Udc_DettaglioMap() {
// Primary Key
this.HasKey(t => new { t.Id_Udc, t.Id_Articolo });
// Relationships
this.HasRequired(t => t.FK_Udc_Dettaglio_Articoli)
.WithMany(t => t.FK_Udc_Dettaglio_Articoli)
.HasForeignKey(d => d.Id_Articolo);
}
If, by using breeze, i try to perform this query
breeze.EntityQuery.from("Articoli").expand("FK_Udc_Dettaglio_Articoli")
or this one
breeze.EntityQuery.from("Articoli").select("Codice,FK_Udc_Dettaglio_Articoli")
everything works fine, but if i try with this
breeze.EntityQuery.from("Articoli").select("Codice,FK_Udc_Dettaglio_Articoli.Id_Udc")
it throw an exeption :
Unable to locate property 'Id_Udc' on type 'System.Collections.Generic.ICollection`1[AWM.Models.Udc_Dettaglio]'."
Am I missing something in EF model definition ? i guess not because expand utility is working ...