3
我有我的小巧玲瓏的ORM以下複雜的模型建立和拒不堅持:堅持複雜的物體與精緻小巧的ORM
const string sqlQuery = "INSERT INTO Reports (created_at, post_name) VALUES (@CreatedAt, @PostData.PostName)";
_connection.Execute(sqlQuery, report);
namespace Foobar.Models
{
public class Report
{
public int Id { get; set; }
public DateTime CreatedAt { get; set; }
public PostData PostData { get; set; }
}
public class PostData
{
public string title { get; set; }
public double index { get; set; }
}
}
這是我得到的錯誤:
The member PostData of type Foobar.Models.PostData cannot be used as a parameter value
但這些表達式不被dapper支持? – vinnylinux 2015-02-07 21:58:06
@vinnylinux我試圖在我的回答中進一步解釋。 – 2015-02-07 22:02:10
選擇該對象時是否一樣? – vinnylinux 2015-02-08 03:40:50