Это мой класс:
Код: Выделить всё
public abstract class File
{
[Key]
public string fileName { get; set; }
public double size{ get; set; }
}
public class SubFile: File
{
public string secondName{ get; set; }
}
public class MyContext : DbContext
{
public DbSet subFile{ get; set; }
}
Код: Выделить всё
var sb = new SubFile{ fileName = "test.doc" };
sb.secondName= "test2.doc";
using (var db = new MyContext())
{
db.SubFile.Add(sb);
db.SaveChanges();
}
Ошибка при получении значения из ObjectStateEntry.
подробности см. во внутреннем исключении.
Подробнее здесь: https://stackoverflow.com/questions/198 ... stateentry
Мобильная версия