Skip to content

Instantly share code, notes, and snippets.

@ODataTeam
Created June 30, 2014 08:32
Show Gist options
  • Save ODataTeam/44f1bce60daaa64399e9 to your computer and use it in GitHub Desktop.
Save ODataTeam/44f1bce60daaa64399e9 to your computer and use it in GitHub Desktop.
EdmModel mainModel = new EdmModel();
var mainContainer = new EdmEntityContainer(mainNS, "MainContainer");
var customerType = new EdmEntityType(mainNS, "Customer", (IEdmEntityType)personType);
customerType.AddProperty(new EdmStructuralProperty(customerType, "HomeAddress", new EdmComplexTypeReference((IEdmComplexType)addressType, true)));
mainModel.AddElement(customerType);
var customerSet = new EdmEntitySet(mainContainer, "Customers", customerType);
mainContainer.AddElement(customerSet);
mainModel.AddElement(mainContainer);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment