public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            IssuedCar = await _context.IssuedCar
                        .Include(i => i.Car)
                        .Include(i => i.Client).FirstOrDefaultAsync(m => m.ID == id);

            if (IssuedCar == null)
            {
                return(NotFound());
            }
            ViewData["CarId"]    = new SelectList(_context.Set <Car>(), "ID", "ID");
            ViewData["ClientId"] = new SelectList(_context.Set <Client>(), "ID", "ID");
            return(Page());
        }
        public RouteLegService(LabContext db_, IConfiguration config)
        {
            this.db          = db_;
            this.dbSet       = db_.Set <RouteLeg>();
            AppConfiguration = config;

            string key = AppConfiguration["googleApi:Key"];
            string url = AppConfiguration["googleApi:DirectionsUrl"];

            googleApi = new GoogleApi.Direction(key, url);
        }
 public CountryService(LabContext db_)
 {
     this.db    = db_;
     this.dbSet = db_.Set <Country>();
 }
Exemple #4
0
 public Repository(LabContext context)
 {
     _context = context;
     _dbSet   = _context.Set <T>();
 }
Exemple #5
0
 public Repository(LabContext labContext)
 {
     _labContext = labContext;
     DbSet       = _labContext.Set <T>();
 }
 public void Add(TEntity e)
 {
     db.Set <TEntity>().Add(e);
     db.SaveChanges();
 }
 public MarkerService(LabContext db_)
 {
     this.db    = db_;
     this.dbSet = db_.Set <Marker>();
 }
 public IActionResult OnGet()
 {
     ViewData["CarId"]    = new SelectList(_context.Set <Car>(), "ID", "ID");
     ViewData["ClientId"] = new SelectList(_context.Set <Client>(), "ID", "ID");
     return(Page());
 }