我一直在苦苦挣扎于Peta Poco和相关类,出现了错误信息“找不到PetaPocoProofOfConcept.Resource和PetaPocoProofOfConcept.BookingType之间的分割点”。
我的两个类是:
[TableName("Resource"), PrimaryKey("Id")]
public class Resource
{
public int Id { get; set; }
public string Title { get; set; }
public string Description { get; set; }
public long MinTimeSpan { get; set; }
public long MaxTimeSpan { get; set; }
public long FixedTimeSpan { get; set; }
public DateTime ActiveStart { get; set; }
public DateTime ActiveEnd { get; set; }
public bool Active { get; set; }
public BookingType BookingType { get; set; }
public int StatusId { get; set; }
}
[TableName("BookingType"), PrimaryKey("Id")]
public class BookingType
{
public int Id { get; set; }
public string Name { get; set; }
public string Description { get; set; }
}
执行以下代码时,我遇到了错误:
using (var connection = new SqlConnection(ConnectionString))
{
connection.Open();
var resources = new Database(connection).Query<Resource, BookingType>("SELECT * FROM [Resource]").ToList();
}
我已经阅读了一些文档,但似乎找不到为什么会失败的答案。有人知道吗?
谢谢 :)