z. Creating Core Entities - SparkDevNetwork/Rock GitHub Wiki

Steps

  1. Create your EF Model under Rock.Model (See Entity Notes below)
  2. Build Rock
  3. Run the Rock.CodeGeneration program on the new entities.
  4. This should have updated the RockContext.cs
  5. Manually add the new classes to Visual Studio which will also add the references to the .csproj file.
  6. When ready, commit your changes and push.

Entity Notes

  • When you create new models, add the [DataMember] attribute to all of the entity properties and none of the virtual properties. Then, as you code blocks and need an object to serialize one or more of its virtual properties, add the [DataMember] attribute, but make sure that you never have both the parent and the child objects having each other’s referencing properties both with the [DataMember] attribute.