예제 #1
0
        // 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();
            });
        }
예제 #2
0
 public FirmRepo(PropertyDbContext db, IBlobRepo blob, IConfiguration config, ISubscriptionRepo subRepo)
 {
     _db      = db;
     _blob    = blob;
     _config  = config;
     _subRepo = subRepo;
 }
예제 #3
0
 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();
        }
예제 #5
0
 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);
 }
예제 #6
0
 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);
 }
예제 #7
0
        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();
                }
            }
        }
예제 #8
0
 public ValuesController(PropertyDbContext context)
 {
     this._context = context;
 }
예제 #9
0
 public SqlSalesInfos(PropertyDbContext context)
 {
     _context = context;
 }
 public PropertyDbContextBaseTest()
 {
     Context = new PropertyTestDbContext();
     new DbContextOptionsBuilder <PropertyDbContext>();
     InitDbAsync(Context).GetAwaiter().GetResult();
 }
예제 #11
0
 public ReportRepository(PropertyDbContext context)
 {
     _context = context;
 }
예제 #12
0
 public CityRepository(PropertyDbContext context)
     : base(context)
 {
 }
예제 #13
0
 public PropertyDbContext Get()
 {
     return(_dataContext ?? (_dataContext = new PropertyDbContext()));
 }
예제 #14
0
 public EffortTestBase()
 {
     EffortConnection      = DbConnectionFactory.CreateTransient();
     PropertyDbTestContext = new PropertyDbContext();
     PropertyDbTestContext.Database.CreateIfNotExists();
 }
예제 #15
0
 public void Initialize(PropertyDbContext context, ILogger <BrokerageController> _logger)
 {
 }
예제 #16
0
 public PropertyService(PropertyDbContext propertyDbContext)
 {
     _propertyDbContext = propertyDbContext;
 }
예제 #17
0
 public BrokerController(PropertyDbContext context)
 {
     _context = context;
 }
        private async Task InitDbAsync(PropertyDbContext context)
        {
            await context.Database.MigrateAsync().ConfigureAwait(false);

            await PropertyDbContextSeed.CheckSeedAsync(context).ConfigureAwait(false);
        }
예제 #19
0
 public PropertiesController(IHttpClientFactory clientFactory, PropertyDbContext context)
 {
     _clientFactory = clientFactory;
     _context       = context;
 }
예제 #20
0
 public UnitOfWork(IDatabaseFactory dbFactory, PropertyDbContext dbContext)
 {
     _dbFactory = dbFactory;
     _dbContext = dbContext;
 }
예제 #21
0
 public PropertyService(ILogger <PropertyService> logger, IMapper mapper, PropertyDbContext propertyDbContext)
     : base(logger, mapper)
 {
     _dbContext = propertyDbContext;
 }
예제 #22
0
 public pBrokersWebAPIController(PropertyDbContext context)
 {
     _context = context;
 }
 public SqlPropertyInfos(PropertyDbContext context)
 {
     _context = context;
 }
예제 #24
0
 public SubscriptionRepo(PropertyDbContext db)
 {
     _db = db;
 }
예제 #25
0
 public PropertyManager(PropertyDbContext db, IBlobRepo blob)
 {
     _db   = db;
     _blob = blob;
 }
예제 #26
0
 public AdminRepo(PropertyDbContext db, IConfiguration configuration)
 {
     _db     = db;
     _config = configuration;
 }