示例#1
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 <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);
        }