0

私はこのエンティティを持っています:

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; }

    }
}

Band エンティティにつながる:

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..

ありがとう

4

1 に答える 1