public IActionResult Register(RegisterViewModel model) { if (!ModelState.IsValid) { return(View("Register", model)); } //Upload the data model.account.Login = AccountLogic.CreateLogin(model.login); AccountLogic.CreateAccount(model.account); return(View(model)); }
/// <summary> /// Executes the plug-in. /// </summary> /// <param name="serviceProvider">The service provider.</param> /// <remarks> /// For improved performance, Microsoft Dynamics CRM caches plug-in instances. /// The plug-in's Execute method should be written to be stateless as the constructor /// is not called for every invocation of the plug-in. Also, multiple system threads /// could execute the plug-in at the same time. All per invocation state information /// is stored in the context. This means that you should not use global variables in plug-ins. /// </remarks> #region Execute Methods protected void ExecutePostAccountCreate(LocalPluginContext localContext) { if (localContext == null) { throw new ArgumentNullException("localContext"); } Guid accountId = localContext.PluginExecutionContext.PrimaryEntityId; using (AccountLogic logic = new AccountLogic(localContext.PluginExecutionContext, localContext.OrganizationService, localContext.TracingService, localContext.CloudService)) { logic.CreateAccount(accountId); } }