public DeployTypesController(DeployDBContext context, IOptions <AzureStorageConfig> config) { _storageConfig = config.Value; _context = context; _service = new DeployTypesService(_context); _tenantService = new TenantParameters(_context, config); }
public static async Task <IActionResult> Run( [HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req, ILogger log) { DeployDBContext _context = new DeployDBContext(); AzureStorageConfig azureStorageConfig = new AzureStorageConfig(); azureStorageConfig.AccountKey = Environment.GetEnvironmentVariable("StorageName"); azureStorageConfig.AccountKey = Environment.GetEnvironmentVariable("StorageKey"); azureStorageConfig.ConnectionString = Environment.GetEnvironmentVariable("StorageConnection"); TenantParameters _tennantService = new TenantParameters(_context, azureStorageConfig); string id = req.Query["id"]; int value = Int16.Parse(id); await _tennantService.GetDeploy(value); //var deployTypes = _context.DeployTypes.Where(d => d.DeployTypeId == value).FirstOrDefault(); string requestBody = await new StreamReader(req.Body).ReadToEndAsync(); dynamic data = JsonConvert.DeserializeObject(requestBody); id = id ?? data?.name; return(null); //return id != null // ? (ActionResult)new OkObjectResult($"Hello, James") // : new BadRequestObjectResult("Please pass a name on the query string or in the request body"); }
public TennantParamsController(DeployDBContext context, IOptions <AzureStorageConfig> config, IHostingEnvironment env) { _context = context; _storageConfig = config.Value; _service = new TenantParameters(_context, config); this.hostingEnv = env; }
public QueueController(DeployDBContext context, IOptions <AzureStorageConfig> config) { _context = context; _storageConfig = config.Value; _service = new TenantParameters(_context, config); }