public static IList <VehicleInformation> GetAllVehicleInformation() { using (FluentModel dbContext = new FluentModel()) { return(dbContext.GetAll <VehicleInformation>().ToList()); } }
public static void InsertRow(int id, string type, string manufactorer, string model, string fuel, string driverFirstName, string driverLastName) { using (FluentModel dbContext = new FluentModel()) { VehicleInformation newRecord = new VehicleInformation(); newRecord.VehicleID = id; newRecord.VehicleType = type; newRecord.Manufactorer = manufactorer; newRecord.VehicleModel = model; newRecord.FuelType = fuel; newRecord.DriverFirstName = driverFirstName; newRecord.DriverLastName = driverLastName; dbContext.Add(newRecord); dbContext.SaveChanges(); } }