public UnitOfWork(BuildingDbContext context, ILoggedInUserService loggedInUserService) { _context = context; Projects = new ProjectRepository(_context); Suppliess = new SuppliesRepository(_context); Buildings = new BuildingRepository(_context); BuildingOuts = new BuildingOutRepository(_context); Components = new ComponentRepository(_context); OutbuildingType = new OutbuildingsTypeRepository(_context); Attachments = new AttachmentRepository(_context); AttachmentContents = new AttachmentContentRepository(_context); _loggedInUserService = loggedInUserService; }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, BuildingDbContext context) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseRouting(); app.UseStaticFiles(); app.UseEndpoints(endpoints => { endpoints.MapDefaultControllerRoute(); }); SeedData.SeedDatabase(context); }
public static void SeedDatabase(BuildingDbContext context) { context.Database.Migrate(); if (context.Buildings.Count() == 0) { context.AddRange( new Building { Name = "First", Description = "The first building", Location = "Main", Number = 100, ImageUrl = "https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Ftse1.mm.bing.net%2Fth%3Fid%3DOIP.gBRzG71aa1f6dy_MuGUwOAHaEo%26pid%3DApi&f=1" }, new Building { Name = "Second", Description = "The second building", Location = "Main", Number = 200, ImageUrl = "https://upload.wikimedia.org/wikipedia/commons/thumb/4/44/Green_Building_-_MIT%2C_Cambridge%2C_MA_-_DSC05589.jpg/1200px-Green_Building_-_MIT%2C_Cambridge%2C_MA_-_DSC05589.jpg" }, new Building { Name = "Third", Description = "The third building", Location = "Side", Number = 10, ImageUrl = "https://c.pxhere.com/photos/60/32/architecture_tower_building_towers_red_brown_low_angle_shot_blue_sky-1401639.jpg!d" }, new Building { Name = "Firth", Description = "The firth building", Location = "Main", Number = 300, ImageUrl = "https://www.publicdomainpictures.net/pictures/20000/nahled/tall-office-building-871299859831cWx.jpg" }, new Building { Name = "Fifth", Description = "The fifth building", Location = "Side", Number = 20, ImageUrl = "https://wonderfulengineering.com/wp-content/uploads/2014/01/beautiful-wallpaper-39.jpg" }, new Building { Name = "Sixth", Description = "The sixth building", Location = "Main", Number = 400, ImageUrl = "http://cdn.homesthetics.net/wp-content/uploads/2015/10/52-Of-The-Most-Famous-Buildings-In-The-World-That-Are-Known-For-Their-Unconventional-Architectural-Structure-11.jpg" }, new Building { Name = "Seventh", Description = "The seventh building", Location = "Main", Number = 500, ImageUrl = "https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Ftse3.mm.bing.net%2Fth%3Fid%3DOIP.on8__7l0en8mg_q2IB-mYQHaKf%26pid%3DApi&f=1" }, new Building { Name = "eight", Description = "The eigth building", Location = "Side", Number = 30, ImageUrl = "https://images.skyscrapercenter.com/building/aoncenter_overall8_mg.jpg" }, new Building { Name = "ninth", Description = "The ninth building", Location = "Side", Number = 40, ImageUrl = "https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Ftse3.mm.bing.net%2Fth%3Fid%3DOIP.JuwmIpr5s02mTir94B1gQAHaEK%26pid%3DApi&f=1" }, new Building { Name = "ten", Description = "The ten building", Location = "Side", Number = 50, ImageUrl = "https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Ftse4.mm.bing.net%2Fth%3Fid%3DOIP.6MIoyeRDXb989CBJXdGpIAHaJ3%26pid%3DApi&f=1" } ); context.SaveChanges(); } }
public AuthenticateService(BuildingDbContext dbcontext, IOptions <JwtToken> tokenManagement, ISysUserService sysUser) { context = dbcontext; _tokenManagement = tokenManagement.Value; _sysUser = sysUser; }
public AttachmentContentRepository(BuildingDbContext dbContext) : base(dbContext) { }
public ComponentRepository(BuildingDbContext dbContext) : base(dbContext) { }
public GenerateColumnsService(BuildingDbContext dbcontext) { context = dbcontext; }
//public ApartmentRepository(IDbContextFactory<BuildingDbContext> dbContext) : base(dbContext) //{ //} public ApartmentRepository(BuildingDbContext dbContext) : base(dbContext) { }
public SuppliesRepository(BuildingDbContext dbContext) : base(dbContext) { }
public ProjectRepository(BuildingDbContext dbContext) : base(dbContext) { }
public GenerateTablesService(BuildingDbContext dbcontext, ISysUserService sysUser) { context = dbcontext; _sysUser = sysUser; }
public BaseRepository(BuildingDbContext dbContext) { _dbContext = dbContext; }
public LookupRepository(IMemoryCache cache, BuildingDbContext dbContext) { _cache = cache; _dbContext = dbContext; }
public AppSettingRepository(IMemoryCache cache, BuildingDbContext dbContext) : base(dbContext) { _cache = cache; }
public OutbuildingsTypeRepository(BuildingDbContext dbContext) : base(dbContext) { }
public BuildingController(BuildingDbContext context) { __context = context; }
public BuildingRepository(BuildingDbContext buildingDbContext) { this.buildingDbContext = buildingDbContext; }
public IncomesRepository(BuildingDbContext dbContext) : base(dbContext) { }
public BuildingOutRepository(BuildingDbContext dbContext) : base(dbContext) { }
public SysUserService(BuildingDbContext dbContext) { context = dbContext; }