public static List <SelectListItem> DriverSSA(int id) { if (id == 0) { return(new List <SelectListItem>()); } CityAppEntities db = new CityAppEntities(); var query = db.tblDrivers.FirstOrDefault(x => x.deleted == null && x.id == id); if (query == null) { throw new HttpException((int)HttpStatusCode.NotFound, "NotFound"); } return(new List <SelectListItem>() { new SelectListItem() { Text = $"{query.driverName}", Value = id.ToString() } }); }
public VehicleHandler() { db = new CityAppEntities(); db.Database.CommandTimeout = ConstantHelper.DB_TIMEOUT; }
public FavouriteDriverHandler() { db = new CityAppEntities(); db.Database.CommandTimeout = ConstantHelper.DB_TIMEOUT; }