Navigate properties when using Dapper Extensions

左心房为你撑大大i 提交于 2019-12-13 00:49:32

问题


Im using DapperExtensions library for simple CRUD operations. When I add a navigate property to my model, I get an error message that this column is not in the database. Can you in any way change this so that Dapper Extensions ignores this property?

Example of my model

public class Order : EntityBase
{
    public int OrderId { get; set; }
    public int MarketId { get; set; }
    public int ModelId { get; set; }
    public int ContactId { get; set; }
    public string Project { get; set; }
    public decimal Undertaking { get; set; }

    public virtual Model Model { get; set; }
    public virtual Contact Contact { get; set; }
}

回答1:


Use the Write attribute above the property

[Write(false)]


来源:https://stackoverflow.com/questions/14606783/navigate-properties-when-using-dapper-extensions

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!