コード例 #1
0
        public static async Task <SiteVariableAmountsFact> Load(WaDEContext db, SiteVariableAmountsFactBuilderOptions opts)
        {
            opts.OrganizationsDim = opts.OrganizationsDim ?? await OrganizationsDimBuilder.Load(db);

            opts.SiteDim = opts.SiteDim ?? await SitesDimBuilder.Load(db);

            opts.VariablesDim = opts.VariablesDim ?? await VariablesDimBuilder.Load(db);

            opts.WaterSourcesDim = opts.WaterSourcesDim ?? await WaterSourcesDimBuilder.Load(db);

            opts.MethodsDim = opts.MethodsDim ?? await MethodsDimBuilder.Load(db);

            opts.TimeframeStart = opts.TimeframeStart ?? await DateDimBuilder.Load(db);

            opts.TimeframeEnd = opts.TimeframeEnd ?? await DateDimBuilder.Load(db);

            opts.DataPublicationDate = opts.DataPublicationDate ?? await DateDimBuilder.Load(db);

            var item = Create(opts);

            db.SiteVariableAmountsFact.Add(item);
            await db.SaveChangesAsync();

            return(item);
        }
コード例 #2
0
        public static async Task <AllocationAmountsFact> Load(WaDEContext db, AllocationAmountsFactBuilderOptions opts)
        {
            opts.OrganizationsDim = opts.OrganizationsDim ?? await OrganizationsDimBuilder.Load(db);

            opts.VariablesDim = opts.VariablesDim ?? await VariablesDimBuilder.Load(db);

            opts.WaterSourcesDim = opts.WaterSourcesDim ?? await WaterSourcesDimBuilder.Load(db);

            opts.MethodsDim = opts.MethodsDim ?? await MethodsDimBuilder.Load(db);

            opts.DataPublicationDate = opts.DataPublicationDate ?? await DateDimBuilder.Load(db);

            opts.AllocationPriorityDate = opts.AllocationPriorityDate ?? await DateDimBuilder.Load(db);

            var item = Create(opts);

            db.AllocationAmountsFact.Add(item);
            await db.SaveChangesAsync();

            return(item);
        }