0
내가이 엔티티가 : 밴드 개체에 이르는BLtoolkit 협회
namespace Entities.dbo
{
[TableName("tbl_question")]
public class Question : AbstractEntity
{
[MapField("c_from")]
[Association(CanBeNull = false, OtherKey = "id", ThisKey = "c_from")]
public User From { get; set; }
[MapField("c_to")]
[Association(CanBeNull = false, OtherKey = "id", ThisKey = "c_to")]
public Band To { get; set; }
}
}
을 :
namespace Entities.dbo
{
[TableName("tbl_band")]
public class Band : AbstractEntity
{
[MapField("name")]
public string Name { get; set; }
[MapField("frontman")]
[Association(CanBeNull = false, ThisKey = "frontman", OtherKey = "id")]
public User Frontman { get; set; }
}
}
하지만 같은 질문에 도착하려고하면
public static List<Question> GetQuestions(Band band)
{
using (var db = new MyDbManager())
{
try
{
var l = db.GetTable<Question>().Where(x => x.To == band).ToList();
return l;
}catch(Exception e)
{
return null;
}
}
을 나는이 예외를 가지고 :
Association key 'c_to' not found for type 'Entities.dbo.Question.
어떤 아이디어라도 문제가 있습니까?
난 .. 테이블 tbl_question에 열 c_to이라는 ThisKey 재산권 협회가 정의 측면에서 키 필드 (콤마 구분)를 나타낸다