c# - ForeignKey String ToLower Entity Framework -
i have problem foreignkey, see in database table have following value "la urbina" in column "equ". in model property is:
[foreignkey("equipo")] public string equ { get; set; } private equipo equipo; public virtual equipo equipo { { return equipo; } set { equipo = value; } }
the problem in table "equipo" key code "la urbina" not "la urbina" , therefore not make relationship, idea make comparison regardless if value lower or upper? please excuse bad english, hope understand me , can me
you must check "collation" database using.
for example, "latin1_general_100_cs_ai" - cs indicates strings in database "case-sensitive" , string "la urbina" , "la urbina" different.
if ""latin1_general_100_ci_ai" - ci indicates string in database "case-insensitive" , there no differences between 2 strings.
in order change database collation, re-create (nasty scenario) or right click -> options -> collation.