我有2节课。
public class Name
{
public string FirstName { get; set; }
public string LastName { get; set; }
}
class Person
{
public virtual Name Name { get; set; }
public virtual int Age { get; set; }
}
我想像这样将 Person 映射到数据库:
| First Name | LastName | Age |
我尝试为 Name 创建 IUserType 实现。但在这儿
public SqlType[] SqlTypes
{
get { return new[] { new SqlType(DbType.String), new SqlType(DbType.String) }; }
}
我有一个例外
property mapping has wrong number of columns