예제 #1
0
		public ActionResult AddAzureSubscriptionStep4(FinishAddingAzureSubscription cmd) {
			AzureSubscriptions.Handle(cmd);
			return RedirectToRoute("Home");
		}
예제 #2
0
		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();
            });
		}