Castle ActiveRecord是否支持SQL公式?

Ami*_*abh 1 nhibernate castle-activerecord

Castle ActiveRecord是否支持nHibernate支持的SQL公式?

例如,在nHibernate中,我们可以做这样的事情.

<property name="CountOfPosts"
    formula="(select count(*) from Posts where Posts.Id = Id)"/>
Run Code Online (Sandbox Code Playgroud)

Castle Active Record是否支持此功能?

Mau*_*fer 5

是的,[Property]属性有一个Formula属性.

[Property(Formula = "(select count(*) from Posts where Posts.Id = Id)")]
public int CountOfPosts {get;set;}
Run Code Online (Sandbox Code Playgroud)