2010-02-25 23 views
1

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

例如在nHibernate中,我們可以做這樣的事情。

<property name="CountOfPosts" 
    formula="(select count(*) from Posts where Posts.Id = Id)"/> 

這是Castle Active Record支持的嗎?

回答

5

是的,[Property] attribute有一個公式屬性。

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