The use of BusinessController Create

The use of BusinessController Create

Here's the code to create data using the BusinessController, as explained in this video:

#region Instantiate BusinessController

SilverBusinessController organizationController =
Solution.ConfigurationManager.ControllerCache.Controller(
"Organization",
Solution.ConfigurationManager.ConfigurationFile,
SilverApplication.Configuration.ApplicationDocument,
USER_SESSION.GetSecurityProperties(),
Solution.TranslationsCache,
Solution.Configuration, SilverApplication.AccessControllerCache);

#endregion

#region Fetch for default values

organizationController.MainBusinessEntity.Fetch("");

#endregion

#region Set Values

organizationController.MainBusinessEntity.Data.Property("Name").Value = organizationName;
organizationController.MainBusinessEntity.Data.Property("City").Value = organizationCity;

#endregion

#region Do Create

organizationController.Create(organizationController.MainBusinessEntity.Data);
string NewOrganizationID = organizationController.MainBusinessEntity.Data.KeyProperty.ValueToString;

#endregion