public Reservation Get(int id)
 {
     using (var context = new MaintenanceContext())
     {
         return(context.Reservations
                .FirstOrDefault(r => r.Id == id));
     }
 }
 public void Remove(Reservation reservation)
 {
     using (var context = new MaintenanceContext())
     {
         context.Entry(reservation).State = System.Data.Entity.EntityState.Deleted;
         context.SaveChanges();
     }
 }
Beispiel #3
0
 public void Create(Car car)
 {
     using (var context = new MaintenanceContext())
     {
         context.Cars.Add(car);
         context.SaveChanges();
     }
 }
 public void Create(Reservation reservation)
 {
     using (var context = new MaintenanceContext())
     {
         context.Reservations.Add(reservation);
         context.SaveChanges();
     }
 }
Beispiel #5
0
 public void Create(Maintenance maintenance)
 {
     using (var context = new MaintenanceContext())
     {
         context.Maintenances.Add(maintenance);
         context.SaveChanges();
     }
 }
Beispiel #6
0
 public void Update(Maintenance maintenance)
 {
     using (var context = new MaintenanceContext())
     {
         context.Entry(maintenance).State = System.Data.Entity.EntityState.Modified;
         context.SaveChanges();
     }
 }
Beispiel #7
0
        /// <summary>
        /// The contructor requires an open DataContext to work with
        /// </summary>
        /// <param name="context">An open DataContext</param>

        public RepositoryMaintenanceMk2(MaintenanceContext context)
        {
            this.Context = context;
            try
            {
                this.Entities = context.Set <TEntity>();
            }
            catch
            {
                this.Queries = context.Query <TEntity>();
            }
        }
Beispiel #8
0
 public RepositoryBase(MaintenanceContext repositoryPatternDemoContext)
 {
     RepositoryPatternDemoContext = repositoryPatternDemoContext;
 }
 public MaintenanceController(MaintenanceContext context)
 {
     _context = context;
 }
Beispiel #10
0
        /// <summary>
        /// The contructor requires an open DataContext to work with
        /// </summary>
        /// <param name="context">An open DataContext</param>

        public RepositoryMaintenance(MaintenanceContext context)
        {
            this.Context = context;
            Entities     = context.Set <TEntity>();
        }
Beispiel #11
0
 public ManutencaoService(MaintenanceContext context)
 {
     this._context = context;
 }
Beispiel #12
0
 public MachinesRepository()
 {
     db = new MaintenanceContext();
 }
Beispiel #13
0
 public AircraftController(MaintenanceContext context)
 {
     _context = context;
 }
Beispiel #14
0
 public SchedulesRepository()
 {
     db = new MaintenanceContext();
 }
 public ProductRepository(MaintenanceContext repositoryPatternDemoContext) : base(repositoryPatternDemoContext)
 {
 }
Beispiel #16
0
 public EmployeesRepository()
 {
     db = new MaintenanceContext();
 }