Beispiel #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);
        }
        public static async Task <Nhdproduct> Load(WaDEContext db, NhdproductBuilderOptions opts)
        {
            var item = Create(opts);

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

            return(item);
        }
        public static async Task <RegulatoryStatus> Load(WaDEContext db, RegulatoryStatusBuilderOptions opts)
        {
            var item = Create(opts);

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

            return(item);
        }
Beispiel #4
0
        public static async Task <WaterSourceType> Load(WaDEContext db, WaterSourceTypeBuilderOptions opts)
        {
            var item = Create(opts);

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

            return(item);
        }
        public static async Task <VariableSpecific> Load(WaDEContext db, VariableSpecificBuilderOptions opts)
        {
            var item = Create(opts);

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

            return(item);
        }
        public static async Task <CoordinateMethod> Load(WaDEContext db, CoordinateMethodBuilderOptions opts)
        {
            var item = Create(opts);

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

            return(item);
        }
Beispiel #7
0
        public static async Task <WaterQualityIndicator> Load(WaDEContext db, WaterQualityIndicatorBuilderOptions opts)
        {
            var item = Create(opts);

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

            return(item);
        }
        public static async Task <Units> Load(WaDEContext db, UnitsBuilderOptions opts)
        {
            var item = Create(opts);

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

            return(item);
        }
        public static async Task <BeneficialUsesCV> Load(WaDEContext db, BeneficalUsesBuilderOptions opts)
        {
            var item = Create(opts);

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

            return(item);
        }
Beispiel #10
0
        public static async Task <AggregationStatistic> Load(WaDEContext db, AggregationStatisticBuilderOptions opts)
        {
            var item = Create(opts);

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

            return(item);
        }
        public static async Task <Epsgcode> Load(WaDEContext db, EpsgcodeBuilderOptions opts)
        {
            var item = Create(opts);

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

            return(item);
        }
    public static async Task <SDWISIdentifier> Load(WaDEContext db, SDWISIdentifierBuilderOptions opts)
    {
        var item = Create(opts);

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

        return(item);
    }
Beispiel #13
0
        public static async Task <ReportYearType> Load(WaDEContext db, ReportYearTypeBuilderOptions opts)
        {
            var item = Create(opts);

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

            return(item);
        }
        public static async Task <NhdnetworkStatus> Load(WaDEContext db, NhdnetworkStatusBuilderOptions opts)
        {
            var item = Create(opts);

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

            return(item);
        }
        public static async Task <GnisfeatureName> Load(WaDEContext db, GnisfeatureNameBuilderOptions opts)
        {
            var item = Create(opts);

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

            return(item);
        }
        public static async Task <OrganizationsDim> Load(WaDEContext db, OrganizationsDimBuilderOptions opts)
        {
            opts.State = opts.State ?? await StateBuilder.Load(db);

            var item = Create(opts);

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

            return(item);
        }
        public static async Task <MethodsDim> Load(WaDEContext db, MethodsDimBuilderOptions opts)
        {
            opts.ApplicableResourceType = opts.ApplicableResourceType ?? await ApplicableResourceTypeBuilder.Load(db);

            opts.MethodType = opts.MethodType ?? await MethodTypeBuilder.Load(db);

            var item = Create(opts);

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

            return(item);
        }
Beispiel #18
0
        public static async Task <AllocationBridgeSitesFact> Load(WaDEContext db, AllocationBridgeSitesFactBuilderOptions opts)
        {
            opts.SitesDim = opts.SitesDim ?? await SitesDimBuilder.Load(db);

            opts.AllocationAmountsFact = opts.AllocationAmountsFact ?? await AllocationAmountsFactBuilder.Load(db);

            var item = Create(opts);

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

            return(item);
        }
        public static async Task <WaterSourcesDim> Load(WaDEContext db, WaterSourcesDimBuilderOptions opts)
        {
            opts.WaterSourceType = opts.WaterSourceType ?? await WaterSourceTypeBuilder.Load(db);

            opts.WaterQualityIndicator = opts.WaterQualityIndicator ?? await WaterQualityIndicatorBuilder.Load(db);

            var item = Create(opts);

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

            return(item);
        }
        public static async Task <State> Load(WaDEContext db, StateBuilderOptions opts)
        {
            var item = Create(opts);

            var exists = db.State.Find(item.Name);

            if (exists != null)
            {
                return(exists);                // State Private Key 'Name' is only 2 chars...Faker generates the same key alot...if that happens dont let the test break, just reuse the existing state
            }
            db.State.Add(item);
            await db.SaveChangesAsync();

            return(item);
        }
Beispiel #21
0
        public static async Task <ReportingUnitsDim> Load(WaDEContext db, ReportingUnitsDimBuilderOptions opts)
        {
            opts.ReportingUnitType = opts.ReportingUnitType ?? await ReportingUnitTypeBuilder.Load(db);

            opts.State = opts.State ?? await StateBuilder.Load(db);

            opts.Epsgcode = opts.Epsgcode ?? await EpsgcodeBuilder.Load(db);

            var item = Create(opts);

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

            return(item);
        }
        public static async Task <ReportingUnitType> Load(WaDEContext db, ReportingUnitTypeBuilderOptions opts)
        {
            var item = Create(opts);

            var matching = db.ReportingUnitType.FirstOrDefault(a => a.Name == item.Name);

            if (matching == null)
            {
                db.ReportingUnitType.Add(item);
                await db.SaveChangesAsync();

                matching = item;
            }

            return(matching);
        }
Beispiel #23
0
        public static async Task <DateDim> Load(WaDEContext db, DateDimBuilderOptions opts)
        {
            var item = Create(opts);

            var matchingDate = db.DateDim.FirstOrDefault(a => a.Date == item.Date);

            if (matchingDate == null)
            {
                db.DateDim.Add(item);
                await db.SaveChangesAsync();

                matchingDate = item;
            }

            return(matchingDate);
        }
Beispiel #24
0
        public static async Task <RegulatoryOverlayDim> Load(WaDEContext db, RegulatoryOverlayDimBuilderOptions opts)
        {
            opts = opts ?? new RegulatoryOverlayDimBuilderOptions();

            opts.RegulatoryStatus = opts.RegulatoryStatus ?? await RegulatoryStatusBuilder.Load(db);

            opts.RegulatoryOverlayType = opts.RegulatoryOverlayType ?? await RegulatoryOverlayTypeBuilder.Load(db);

            opts.WaterSourceType = opts.WaterSourceType ?? await WaterSourceTypeBuilder.Load(db);

            var item = Create(opts);

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

            return(item);
        }
Beispiel #25
0
        public static async Task <AggregatedAmountsFact> Load(WaDEContext db, AggregatedAmountsFactBuilderOptions opts)
        {
            opts.OrganizationsDim = opts.OrganizationsDim ?? await OrganizationsDimBuilder.Load(db);

            opts.ReportingUnitsDim = opts.ReportingUnitsDim ?? await ReportingUnitsDimBuilder.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);

            var item = Create(opts);

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

            return(item);
        }
Beispiel #26
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);
        }
Beispiel #27
0
        public static async Task <VariablesDim> Load(WaDEContext db, VariablesDimBuilderOptions opts)
        {
            opts.VariableSpecific = opts.VariableSpecific ?? await VariableSpecificBuilder.Load(db);

            opts.Variable = opts.Variable ?? await VariableBuilder.Load(db);

            opts.AggregationStatistic = opts.AggregationStatistic ?? await AggregationStatisticBuilder.Load(db);

            opts.AggregationIntervalUnit = opts.AggregationIntervalUnit ?? await UnitsBuilder.Load(db);

            opts.ReportYearType = opts.ReportYearType ?? await ReportYearTypeBuilder.Load(db);

            opts.AmountUnit = opts.AmountUnit ?? await UnitsBuilder.Load(db);

            var item = Create(opts);

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

            return(item);
        }
        public static async Task <SitesDim> Load(WaDEContext db, SitesDimBuilderOptions opts)
        {
            opts.CoordinateMethodCvNavigation = opts.CoordinateMethodCvNavigation ?? await CoordinateMethodBuilder.Load(db);

            opts.EpsgcodeCvNavigation = opts.EpsgcodeCvNavigation ?? await EpsgcodeBuilder.Load(db);

            opts.GniscodeCvNavigation = opts.GniscodeCvNavigation ?? await GnisfeatureNameBuilder.Load(db);

            opts.NhdnetworkStatusCvNavigation = opts.NhdnetworkStatusCvNavigation ?? await NhdnetworkStatusBuilder.Load(db);

            opts.NhdproductCvNavigation = opts.NhdproductCvNavigation ?? await NhdproductBuilder.Load(db);

            opts.SiteTypeCvNavigation = opts.SiteTypeCvNavigation ?? await SiteTypeBuilder.Load(db);

            opts.StateCVNavigation = opts.StateCVNavigation ?? await StateBuilder.Load(db);

            var item = Create(opts);

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

            return(item);
        }