I'm pulling my hair out to get this to work. In my mind it should be fairly simple, but it just don't want to work.
Base info: System: Umbraco 4.5.2
Goal I have a webservice. This webservice receives some data, one of these is a "Web Category Id". I have to search my Tree for this category. For this purpose i have made a document type called "ContainerProductCategory" and have made a property called "id" (alias CategoryId). When i have found this Node i will use this as the Parent for my new Node which is a "product" document type.
Problem So far i have used the "Export to .NET" on the document types, put the .cs files in the App_Code folder, and i my webservice refferenced to the namespace of it. I have no errors a all, but when i try to call the webservice, it returns no nodes ("System.InvalidOperationException: Sequence contains no elements"). I have made the categories in the Tree and can see them there, but they apperently can't get selected when i use the LinQ
My Webservice code
public
classHedensted : System.Web.Services.WebService {
umbraco.BusinessLogic.
User user = new umbraco.BusinessLogic.User(0);
privateLinqDataContext ctx;
public Hedensted () {
//Uncomment the following line if using designed components
//InitializeComponent();
}
[
WebMethod]
publicstring InsertProduct(string No, string Language, string Description1, string Description2, string Amount_DKK, string Amount_EUR, int WebKategori, bool EnableOnWeb, bool DeleteOnWeb)
{
ctx =
newLinqDataContext();
var allProducts = (from productCategory in ctx.ContainerProductCategorys
The problem was in the "publish" of the document types. If i choose a "sub" node at publish it + child nodes it doesn't update the XML schema for change alias names of the document types. I have to do a complete republish of the entire site from the top node.
Urgent! Help Needed with LinQ to Umbraco
Hi There,
I'm pulling my hair out to get this to work. In my mind it should be fairly simple, but it just don't want to work.
Base info:
System: Umbraco 4.5.2
Goal
I have a webservice. This webservice receives some data, one of these is a "Web Category Id". I have to search my Tree for this category. For this purpose i have made a document type called "ContainerProductCategory" and have made a property called "id" (alias CategoryId). When i have found this Node i will use this as the Parent for my new Node which is a "product" document type.
Problem
So far i have used the "Export to .NET" on the document types, put the .cs files in the App_Code folder, and i my webservice refferenced to the namespace of it. I have no errors a all, but when i try to call the webservice, it returns no nodes ("System.InvalidOperationException: Sequence contains no elements"). I have made the categories in the Tree and can see them there, but they apperently can't get selected when i use the LinQ
My Webservice code
Problem solved...
The problem was in the "publish" of the document types. If i choose a "sub" node at publish it + child nodes it doesn't update the XML schema for change alias names of the document types. I have to do a complete republish of the entire site from the top node.
Kind regards
\T
is working on a reply...