2012-01-25 74 views
0

我使用Linq將Umbraco廣泛用於只讀操作即。如何堅持使用UmbracoDataContext

IEnumerable<Country> countries = MyContainer.Instance.Countries.Where(c => c.NodeName == currentLocation); 

我怎麼會着手做一些像

Country c = new Country(); 
c.Name "australia"; 

Instance.persist(c); for eg. 

我總是用傳統的形式之下,但我想知道,如果這樣做的人寫的LINQ 2一把umbraco以及如何可能被結構化

DocumentType dt = DocumentType.GetByAlias("Textpage"); 
User author = User.GetUser(0); 

Document doc = Document.MakeNew("My new document", dt, author, 1018); 

回答

0

據我所知,Linq2Umbraco仍然是純粹的只讀 - 見this article瞭解詳情。我也從this thread看到它仍然是這樣。

就我個人而言,我仍然使用與你自己相同的方法。

+0

我想你是對的。鏈接提到了一些關於CRUD在UmbracoDataProvider中潛在可用的內容,然而似乎是由開發人員來實現他們需要的東西。 – MikeW