Пример #1
0
        public async Task <IEnumerable <OdsComponent> > Execute(CloudOdsInstance instance)
        {
            var fileName = ConfigurationManager.AppSettings["HostedComponentsFile"];
            var filePath = HostingEnvironment.MapPath(fileName);

            if (filePath == null)
            {
                throw new FileNotFoundException("Can't locate HostedComponents file");
            }

            using (var sr = File.OpenText(filePath))
            {
                var componentsString = await sr.ReadToEndAsync();

                var odsComponents = Json.Decode <List <OdsComponent> >(componentsString);

                return(odsComponents);
            }
        }
Пример #2
0
 private async Task <OdsFirstTimeSetupConfiguration> GetFirstTimeSetupConfiguration(CloudOdsInstance cloudOdsInstance, CloudOdsClaimSet claimSet, OdsSqlConfiguration odsSqlConfiguration)
 {
     return(new OdsFirstTimeSetupConfiguration
     {
         Name = cloudOdsInstance.FriendlyName,
         Version = cloudOdsInstance.Version,
         Components = await _getCloudOdsHostedComponentsQuery.Execute(cloudOdsInstance),
         SqlConfiguration = odsSqlConfiguration,
         ClaimSet = claimSet
     });
 }