I'm working on creating an item in the sitecore database, I want to add the entire completed object to the database and not element by element.

Is there a way to get interface mapping to create a concrete implementation/mock using glass mapper without creating the item in the sitecore database?

 interface MySampleInterface { 
   someProp {get; set;}

var ss = new SitecoreService();
var sample = ss.CreateItem<MySampleInterface>(new CreateOptions());

Unless I'm miss reading the docs the "CreateItem" indicates it adds the item to the database.

  • 1
    Welcome to Sitecore Stack Exchange! Can you add an example of how you have your models set up currently? – Dan Sinclair Jan 14 '19 at 20:20
  • Your question is quite vague, can you provide a little more detail about what you are referring to. Specifically I'm not sure why you would need to create a glass interface, when that wouldn't exist in Sitecore? – Dylan Young Jan 14 '19 at 20:26
  • updated with more docs. – Adam Hess Jan 14 '19 at 20:34
  • 4
    Just create a concrete implementation of your interface and new it up. – Richard Seal Jan 14 '19 at 21:12
  • It was easier just to do the one by one, given the small amount of data processing. Was not worth the time investment trying to figure it out for my use case. – Adam Hess Jan 22 '19 at 16:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.