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
I try to bulk create the content, one of the property is a vorto textstring
here is the code, when call the SetValue content an error occur
"UMBRACO The best overloaded mthod match for 'Umbraco.Core.Models.ContentBase.SetPropertyValue(string, string)' has some invalid arguments"
anybody can help with this, thanks a lot
var cs = _applicationContext.Services.ContentService; var dts = _applicationContext.Services.DataTypeService; Guid vortoTextstringGuid = dts.GetAllDataTypeDefinitions().Where(x => x.Name == "Vorto Textstring").FirstOrDefault().Key; var newContent = cs.CreateContent(name: "newItem, parentId: 6500, contentTypeAlias: "itemTypeAlias", userId: 0); VortoValue newVortoItem = new VortoValue(); newVortoItem.Values = new Dictionary<string, object>(); department.Values.Add("en-US", (object)"English"); department.Values.Add("zh-HK", (object)"Chinese"); newContent.SetValue("ItemPropTypeAlias", (object)newVortoItem ); cs.Save(newContent);
In case someone to looking for this
newContent.SetValue("ItemPropTypeAlias", JsonConvert.SerializeObject(newVortoItem ));
Hi Samay
Thanks for sharing, really nice tip! #h5yr
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
How can I set vorto value to content via code ?
I try to bulk create the content, one of the property is a vorto textstring
here is the code, when call the SetValue content an error occur
"UMBRACO The best overloaded mthod match for 'Umbraco.Core.Models.ContentBase.SetPropertyValue(string, string)' has some invalid arguments"
anybody can help with this, thanks a lot
In case someone to looking for this
Hi Samay
Thanks for sharing, really nice tip! #h5yr
is working on a reply...