c# - Deleting content based upon document type using the Umbraco content service -


I wrote a web service call that dynamically creates a page based on feedback from the web service every 60 seconds. The service I am using is a general weather forecasting service that predicts 7 days of weather in a specific area. All new content nodes are created using the following:

  var weather = cs.CreateContent ("weather forecast" + forecast. Date, root id, "weather"); // where is the homepad of the root id site  

As I'm finally going to optimize this web service call so that only one set of results can be displayed (most recent Set) I want to try and delete the content based on the document type. Is this possible? What I have seen here is: It is not, but should be an alternate solution so that I bulk old content created with web service call and replace it with the most recent content.

I thought that something like this would be possible:

  cs.GetChildren (rootID). Where (x = & gt; x.DocumentTypeAlias ​​== "weather");  

But according to my visual studio it appears invalid.

Any help would be greatly appreciated.

/ Jason

This is entirely possible using the following syntax:

  var weatherpages = cs.GetChildren (root id). Where (x = & gt; x.ContentType.Alias ​​== "weather");  

Each matching pages can be removed using the following syntax:

  foreach (different items in weather page) {cs.Delete ( Item); }  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -