को numer 1 कहते हैं मैं इस दो entityesइकाई की रूपरेखा अमान्य स्तंभ का नाम, एफई प्राथमिक कुंजी
public partial class Suscriptores
{
public Suscriptores()
{
this.Publicacion = new HashSet<Publicacion>();
}
[Key]
public int IdSuscriptor { get; set; }
public string LogoSuscriptor { get; set; }
public string Identificacion { get; set; }
public string Nombre { get; set; }
public string Direccion { get; set; }
public string Telefono { get; set; }
public string Email { get; set; }
public string Fax { get; set; }
public string Home { get; set; }
public virtual ICollection<Publicacion> Publicacion { get; set; }
}
public partial class Publicacion
{
public Publicacion()
{
this.Edictos = new HashSet<Edictos>();
}
[Key]
public decimal IdPublicacion { get; set; }
public System.DateTime FechaPublicacion { get; set; }
public string IdUsuario { get; set; }
public System.DateTime FechaPublicacionHasta { get; set; }
public System.DateTime FechaArchivoHasta { get; set; }
public int IdSuscriptor { get; set; }
public decimal IdTipoPublicacion { get; set; }
[ForeignKey("IdSuscriptor")]
public virtual Suscriptores Suscriptores { get; set; }
}
जब कोशिश इस क्वेरी चलाने के लिए है:
:public ActionResult DetailsVSTO(string Identificacion)
{
var SusQ = from s in db.Suscriptores
where s.Identificacion == Identificacion
select s;
return Json(SusQ.First(), JsonRequestBehavior.AllowGet);
}
यह इस संदेश को फेंक
System.Data.SqlClient.SqlException: अमान्य कॉलम नाम 'Suscriptores_IdSuscriptor1'
ऐसा करने का प्रयास lve इस समस्या को मैं DBCOntext
modelBuilder.Entity<Suscriptores>()
.HasMany(x => x.Publicacion)
.WithRequired(x => x.Suscriptores)
.Map(a => a.MapKey("IdSuscriptor"));
पर इस धाराप्रवाह जोड़ने लेकिन समस्या जारी रहती है। मैं इसे हल करने के लिए कैसे कर सकता हूं।
बस उत्सुक है, यह एक बहुत-tomany संघ नहीं होना चाहिए? मैं कुछ जानते हुए भी कि मैं केवल एक ग्राहक :) 3 +1 आज गर्ट के बारे में –
thats प्राप्त कर सकते हैं प्रकाशित करने के लिए नहीं करना चाहते हैं। मैं के लिए अपने "टिप्पणी" आपकी पोस्ट :-) –
Tks गर्ट पसंद है, वास्तव में मैं एफई के साथ नए हूँ, इसके साथ बस कुछ छोटा सा अनुभव।प्रत्येक '' सबस्क्राइटर 'और' 'सबस्क्राइटर' 'के लिए' 'पब्लिकेशियंस' 'के लिए कई' 'पब्लिकेशियोन' 'हैं, जो मैं मॉडल बनाना चाहता हूं। –