error mapping sql types in derived types #4251
Labels
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
type-bug
Milestone
This is an odd one I found while trying to repo a different issue. Notice that SpecialUser1 and 2 both derive from ApplicationUser. Also notice that they both define "Sex" but of different type. Probably this is an error on the dev's part, but in more complex hierarchies maybe that happens.
The problem is that EF scripts successfully into the database with "sex" column of type int, while SpecialUser2.Sex is type string! I'd expect an error to be thrown.
This is with RC2 16649. Did you loosen up error checking since RC1 - because that might explain why I can't repo the other issue I had where defining the same property in two sibling derived types threw an error, even if they used the same type. (#4224)
using Microsoft.AspNet.Identity.EntityFramework;
using Microsoft.Data.Entity;
namespace WebApplication5
{
public class ApplicationUser : IdentityUser
{
}
public class SpecialUser1 : ApplicationUser
{
//same property in SpecialUser1 and SpecialUser2
public char Sex { get; set; }
}
}
The text was updated successfully, but these errors were encountered: