Esempio n. 1
0
 public static IList <VehicleInformation> GetAllVehicleInformation()
 {
     using (FluentModel dbContext = new FluentModel())
     {
         return(dbContext.GetAll <VehicleInformation>().ToList());
     }
 }
Esempio n. 2
0
        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();
            }
        }