Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi I have the following snippet:
var course = new Backend.DomainModel.UmbracoObjects.Course(); course.CourseStart = DateTime.Parse(courseStart.Text); course.CourseEnd = DateTime.Parse(courseEnd.Text); course.Recurrence = repeatDropdown.SelectedValue; course.CourseValuePerHour = int.Parse(courseValueTextbox.Text); course.MaxCapacity = int.Parse(capacityTextbox.Text); course.Location = location.Text; course.CourseColor = "#" + courseColorTextbox.Text; using (var ctx = new Backend.DomainModel.UmbracoObjects.WilshireUmbracoContextDataContext()) { var coursesNode = (from c in ctx.Coursess select c).Single(); coursesNode.CoursesChildren.InsertOnSubmit(course); }
When I insert into the parrentnode I get the following:
So is it not possible to write nodes with lin2umbraco?
Linq2Umbraco is only used to read data and uses the NodeFactory. If you want to create data you can do that with the Document object, but Linq2Umbraco does not support this.
There have been some experiments with creating nodes with Linq2Umbraco, but I don't know if they where ever released: http://www.aaron-powell.com/documentdataprovider-overview.
Jeroen
Meh.. I guess thats not the answer I was hoping for. I'll create it oldschool way instead then
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Creating nodes with linq2umbraco not possible?
Hi I have the following snippet:
When I insert into the parrentnode I get the following:
The NodeAssociationTree does not support Inserting items
So is it not possible to write nodes with lin2umbraco?
Linq2Umbraco is only used to read data and uses the NodeFactory. If you want to create data you can do that with the Document object, but Linq2Umbraco does not support this.
There have been some experiments with creating nodes with Linq2Umbraco, but I don't know if they where ever released: http://www.aaron-powell.com/documentdataprovider-overview.
Jeroen
Meh.. I guess thats not the answer I was hoping for. I'll create it oldschool way instead then
is working on a reply...