public ActionResult AddAzureSubscriptionStep4(FinishAddingAzureSubscription cmd) { AzureSubscriptions.Handle(cmd); return RedirectToRoute("Home"); }
internal static void Handle(FinishAddingAzureSubscription cmd) { DataContext.Do(context=>{ var session = context.AddAzureSubscriptionSessions.Find(cmd.SessionId); context.AzureSubscriptions.Add(new AzureSubscription { Name = cmd.AzureSubscriptionName, AzureSubscriptionId = session.AzureSubscriptionId, AddedOnUtc = DateTime.UtcNow, FromSessionId = cmd.SessionId, Pfx = session.Pfx, Password= session.Password, }); context.AddAzureSubscriptionSessions.Remove(session); context.SaveChanges(); }); }