(I'm using Sitecore 8.1 Update 3 with Glass Mapper.Sc version 4.1.1.66)
I'm trying to get items to be created in Sitecore through Glass Mapper. We can get content items just fine right now.
But when I try to save, I get this error:
Item does not have a Template ID or Branch ID.
I have verified that object is code has a Template Id.
This is what our property map looks like for the base item (where TempalteID resides):
public override void Configure()
{
Map(config =>
{
config.AutoMap();
config.Id(m => m.Id);
config.Info(m => m.Name).InfoType(SitecoreInfoType.Name);
config.Info(m => m.DisplayName).InfoType(SitecoreInfoType.DisplayName);
config.Info(m => m.Path).InfoType(SitecoreInfoType.Path);
config.Info(m => m.Url).InfoType(SitecoreInfoType.Url);
config.Info(m => m.FullPath).InfoType(SitecoreInfoType.FullPath);
config.Info(m => m.TemplateName).InfoType(SitecoreInfoType.TemplateName);
config.Info(m => m.TemplateId).InfoType(SitecoreInfoType.TemplateId);
config.Field(f => f.Sortorder).FieldName("__Sortorder");
});
}
Here's what the call to Create looks like:
using (new SecurityDisabler())
{
resultItem = _sitecoreContext.Create(parentItem, contentItem, true, false);
}
Any ideas why I'm getting that error?
EDIT: Here's the interface with the templateid attribute.
[SitecoreType(TemplateId = "{DAF085E8-602E-43A6-8299-038FF171349F}")]
public interface IAssetUgcImageModel : IAssetUgcMediaModel
{
string Alt { get; }
}