// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, PropertyDbContext dbContext) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseDatabaseErrorPage(); dbContext.Database.Migrate(); PropertyDbContextSeed.CheckSeedAsync(dbContext).GetAwaiter().GetResult(); } else { app.UseExceptionHandler("/Home/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseRouting(); app.UseAuthentication(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllerRoute( name: "default", pattern: "{controller=Home}/{action=Index}/{id?}"); endpoints.MapRazorPages(); }); }
public FirmRepo(PropertyDbContext db, IBlobRepo blob, IConfiguration config, ISubscriptionRepo subRepo) { _db = db; _blob = blob; _config = config; _subRepo = subRepo; }
public void AddUser(User model) { using (var db = new PropertyDbContext()) { model.UserInsertDate = DateTime.Now; db.Users.Add(model); db.SaveChanges(); } }
public void GivenAPropertyContext() { _context = PropertyDbTestContext; _databaseFactory = new DatabaseFactory(); _unitOfWork = new UnitOfWork(_databaseFactory, _context); _repository = new LocationRepository(_databaseFactory); _autoPocoConfig = new AutoPocoTestDataConfig(); }
public bool UserIdCheck(string id) { using (var db = new PropertyDbContext()) { var checkId = db.Users.FirstOrDefault(ID => ID.UserId.Equals(id)); if (checkId == null) { return(false); } } return(true); }
public bool UserLogin(LoginViewModel model) { using (var db = new PropertyDbContext()) { var user = db.Users.FirstOrDefault(u => u.UserId.Equals(model.UserId) && u.UserPw.Equals(model.UserPw)); if (user != null) { return(true); } } return(false); }
public static void Get() { Console.WriteLine(); using (var db = new PropertyDbContext()) { var bandsWithAlbums = db.Bands .Include(i => i.Musicians) .Include(i => i.Albums) .Include(i => i.Albums.Select(j => j.Tracks)); foreach (var band in bandsWithAlbums) { Console.WriteLine(band.Name); Console.WriteLine(); Console.WriteLine(" -Members:"); Console.WriteLine(); foreach (var musician in band.Musicians) { Console.WriteLine(" " + musician.Name); } Console.WriteLine(); Console.WriteLine(" -Albums:"); Console.WriteLine(); foreach (var album in band.Albums) { Console.WriteLine(" " + album.Name + " - Released " + album.ReleaseDate.ToString("d") + " - Recorded at " + album.Studio + " - Running Time " + album.Length); foreach (var track in album.Tracks) { Console.WriteLine(" " + track.TrackId + " " + track.Name); } Console.WriteLine(); } Console.WriteLine(); } } }
public ValuesController(PropertyDbContext context) { this._context = context; }
public SqlSalesInfos(PropertyDbContext context) { _context = context; }
public PropertyDbContextBaseTest() { Context = new PropertyTestDbContext(); new DbContextOptionsBuilder <PropertyDbContext>(); InitDbAsync(Context).GetAwaiter().GetResult(); }
public ReportRepository(PropertyDbContext context) { _context = context; }
public CityRepository(PropertyDbContext context) : base(context) { }
public PropertyDbContext Get() { return(_dataContext ?? (_dataContext = new PropertyDbContext())); }
public EffortTestBase() { EffortConnection = DbConnectionFactory.CreateTransient(); PropertyDbTestContext = new PropertyDbContext(); PropertyDbTestContext.Database.CreateIfNotExists(); }
public void Initialize(PropertyDbContext context, ILogger <BrokerageController> _logger) { }
public PropertyService(PropertyDbContext propertyDbContext) { _propertyDbContext = propertyDbContext; }
public BrokerController(PropertyDbContext context) { _context = context; }
private async Task InitDbAsync(PropertyDbContext context) { await context.Database.MigrateAsync().ConfigureAwait(false); await PropertyDbContextSeed.CheckSeedAsync(context).ConfigureAwait(false); }
public PropertiesController(IHttpClientFactory clientFactory, PropertyDbContext context) { _clientFactory = clientFactory; _context = context; }
public UnitOfWork(IDatabaseFactory dbFactory, PropertyDbContext dbContext) { _dbFactory = dbFactory; _dbContext = dbContext; }
public PropertyService(ILogger <PropertyService> logger, IMapper mapper, PropertyDbContext propertyDbContext) : base(logger, mapper) { _dbContext = propertyDbContext; }
public pBrokersWebAPIController(PropertyDbContext context) { _context = context; }
public SqlPropertyInfos(PropertyDbContext context) { _context = context; }
public SubscriptionRepo(PropertyDbContext db) { _db = db; }
public PropertyManager(PropertyDbContext db, IBlobRepo blob) { _db = db; _blob = blob; }
public AdminRepo(PropertyDbContext db, IConfiguration configuration) { _db = db; _config = configuration; }