What is correct way to store content part data?

Topics: Administration, Core, Customizing Orchard, General, Writing modules, Writing themes
May 20, 2014 at 9:45 PM
I cannot understand what is correct way to store data in Orchard system. Can anyone compare these several methods? for example we can store data in the following ways:
  1. Create table and use repository directly.
  2. Create ContentPartRecord and ContentPart.
  3. Create ContentPart without Record and use this.Retrieve / this.Store
  4. Create ContentPart without Record and use Retrieve / Store (Is there any difference with or without "this" keyword?)
  5. Create ContentPart without Record and use this.As<InfosetPart>().Get / this.As<InfosetPart>().Set
  6. Create ContentPart and also ContentPartRecord but use Retrieve / Store again (or with this keyword)
  7. Create fields in migration!
I'm really confused. For example why developer of Nwazet.Commerce used Retrieve / Store BUT also created Record?
Do these methods check for existing Record also? If we use data of record table why we store in document db also? I need more information.
Can i use Retrieve / Store or infoset when i need sort or filter on my data?
I used Retrieve / Store but it seems i must manually create importing and exporting methods yet. What is the way for having automatic import/export functionality?

I'm really confused.
Developer
May 21, 2014 at 5:00 PM
See the Training Demo module for several related examples and also an explanation of InfosetPart (and everything linked from there).
Marked as answer by mehranrezaei on 6/17/2014 at 4:42 AM