Exemplo n.º 1
0
        private static async Task SeedGenerateWind(Variable generationVariable)
        {
            var windVariable = new AgreegationSubVariable
            {
                Name       = "Wind",
                VariableId = generationVariable.Id
            };

            await _context.AgreegationSubVariables.AddAsync(windVariable);

            await _context.SaveChangesAsync();

            // Offshore
            var OffshoreSubVariable = new AgreegationSubVariableSubVariable
            {
                Name = "Offshore",
                AgreegationSubVariableId = windVariable.Id
            };

            // Onshore
            var OnshoreSubVariable = new AgreegationSubVariableSubVariable
            {
                Name = "Onshore",
                AgreegationSubVariableId = windVariable.Id
            };
            await _context.AgreegationSubVariableSubVariables.AddAsync(OffshoreSubVariable);

            await _context.AgreegationSubVariableSubVariables.AddAsync(OnshoreSubVariable);

            await _context.SaveChangesAsync();
        }
Exemplo n.º 2
0
        private static async Task SeedGenerateSolar(Variable generationVariable)
        {
            var solarVariable = new AgreegationSubVariable
            {
                Name       = "Solar",
                VariableId = generationVariable.Id
            };

            await _context.AgreegationSubVariables.AddAsync(solarVariable);

            await _context.SaveChangesAsync();

            // Solar PV
            var SolarPVSubVariable = new AgreegationSubVariableSubVariable
            {
                Name = "Solar PV",
                AgreegationSubVariableId = solarVariable.Id
            };

            // Solar thermal
            var SolarThermalVariable = new AgreegationSubVariableSubVariable
            {
                Name = "Solar thermal",
                AgreegationSubVariableId = solarVariable.Id
            };
            await _context.AgreegationSubVariableSubVariables.AddAsync(SolarPVSubVariable);

            await _context.AgreegationSubVariableSubVariables.AddAsync(SolarThermalVariable);

            await _context.SaveChangesAsync();
        }
Exemplo n.º 3
0
        private static async Task SeedElectricCapacitySolar(Variable electricCapacityVariable)
        {
            var solarVariable = new AgreegationSubVariable
            {
                Name       = "Solar",
                VariableId = electricCapacityVariable.Id
            };

            await _context.AgreegationSubVariables.AddAsync(solarVariable);

            await _context.SaveChangesAsync();

            // Solar PV
            var solarpVSubVariable = new AgreegationSubVariableSubVariable
            {
                Name = "Solar PV",
                AgreegationSubVariableId = solarVariable.Id
            };

            // Solar thermal
            var SolarThermalSubVariable = new AgreegationSubVariableSubVariable
            {
                Name = "Solar thermal",
                AgreegationSubVariableId = solarVariable.Id
            };

            await _context.AgreegationSubVariableSubVariables.AddAsync(solarpVSubVariable);

            await _context.AgreegationSubVariableSubVariables.AddAsync(SolarThermalSubVariable);

            await _context.SaveChangesAsync();
        }
Exemplo n.º 4
0
        private static async Task SeedConsumptionBySectorTransport(Variable consumptionBySectorVariable)
        {
            var transportVariable = new AgreegationSubVariable
            {
                Name       = "Transport",
                VariableId = consumptionBySectorVariable.Id
            };

            await _context.AgreegationSubVariables.AddAsync(transportVariable);

            await _context.SaveChangesAsync();

            // Transport - surface
            var transportSurfaceSubVariable = new AgreegationSubVariableSubVariable
            {
                Name = "Transport - surface",
                AgreegationSubVariableId = transportVariable.Id
            };

            // Transport - ships
            var transportShipsSubVariable = new AgreegationSubVariableSubVariable
            {
                Name = "Transport - ships",
                AgreegationSubVariableId = transportVariable.Id
            };

            // Transport - aviation
            var transportAviationSubVariable = new AgreegationSubVariableSubVariable
            {
                Name = "Transport - aviation",
                AgreegationSubVariableId = transportVariable.Id
            };

            await _context.AgreegationSubVariableSubVariables.AddAsync(transportSurfaceSubVariable);

            await _context.AgreegationSubVariableSubVariables.AddAsync(transportShipsSubVariable);

            await _context.AgreegationSubVariableSubVariables.AddAsync(transportAviationSubVariable);

            await _context.SaveChangesAsync();
        }
Exemplo n.º 5
0
        private static async Task SeedElectricCapacityWind(Variable electricCapacityVariable)
        {
            var windVariable = new AgreegationSubVariable
            {
                Name       = "Wind",
                VariableId = electricCapacityVariable.Id
            };

            await _context.AgreegationSubVariables.AddAsync(windVariable);

            await _context.SaveChangesAsync();

            // Offshore
            var offshoreSubVariable = new AgreegationSubVariableSubVariable
            {
                Name = "Offshore",
                AgreegationSubVariableId = windVariable.Id
            };

            // Onshore
            var onshoreSubVariable = new AgreegationSubVariableSubVariable
            {
                Name = "Onshore",
                AgreegationSubVariableId = windVariable.Id
            };

            // Solar PV
            // var ___ SubVariable = new AgreegationSubVariableSubVariable
            // {
            //     Name = "______",
            //     AgreegationSubVariableId = transportVariable.Id
            // };

            await _context.AgreegationSubVariableSubVariables.AddAsync(offshoreSubVariable);

            await _context.AgreegationSubVariableSubVariables.AddAsync(onshoreSubVariable);

            await _context.SaveChangesAsync();
        }
Exemplo n.º 6
0
        private static async Task SeedFinalEnergyConsumptionFuelOilProducts(Variable byFuelVariable)
        {
            var oilProductsVariable = new AgreegationSubVariable
            {
                Name       = "Oil Products",
                VariableId = byFuelVariable.Id
            };

            await _context.AgreegationSubVariables.AddAsync(oilProductsVariable);

            await _context.SaveChangesAsync();

            // Hydrocarbons
            var hydrocarbonsSubVariable = new AgreegationSubVariableSubVariable
            {
                Name = "Hydrocarbons",
                AgreegationSubVariableId = oilProductsVariable.Id
            };

            await _context.AgreegationSubVariableSubVariables.AddAsync(hydrocarbonsSubVariable);

            await _context.SaveChangesAsync();
        }
Exemplo n.º 7
0
 public void Remove(AgreegationSubVariable subVariable)
 {
     context.Remove(subVariable);
 }
Exemplo n.º 8
0
 public void Add(AgreegationSubVariable subVariable)
 {
     context.AgreegationSubVariables.Add(subVariable);
 }