Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var installApiController = new InstallApiController();
- var installSetup = installApiController.GetSetup();
- var instructions = new Dictionary<string, JToken>();
- var databaseModel = new DatabaseModel
- {
- DatabaseType = DatabaseType.SqlCe
- };
- var userModel = new UserModel
- {
- Email = "my@email.com",
- Name = "My name",
- Password = "somepassword",
- SubscribeToNewsLetter = false
- };
- foreach (var step in installSetup.Steps)
- {
- if (step.StepType == typeof(DatabaseModel))
- {
- instructions.Add(step.Name, JToken.FromObject(databaseModel));
- }
- else if (step.StepType == typeof(UserModel))
- {
- instructions.Add(step.Name, JToken.FromObject(userModel));
- }
- }
- var installInstructions = new InstallInstructions
- {
- InstallId = installSetup.InstallId,
- Instructions = instructions
- };
- InstallProgressResultModel progressInfo = null;
- do
- {
- string stepName = "";
- if (progressInfo != null)
- {
- stepName = progressInfo.NextStep;
- }
- try
- {
- progressInfo = installApiController.PostPerformInstall(installInstructions);
- }
- catch (Exception e)
- {
- throw new Exception(stepName, e);
- }
- }
- while (progressInfo.ProcessComplete == false);
Add Comment
Please, Sign In to add comment