コード例 #1
0
 public DbSet <TEntity> SetOf <TEntity>() where TEntity : Entity
 {
     if (Flights is IEnumerable <TEntity> )
     {
         Tickets.Load();
         return(Flights as DbSet <TEntity>);
     }
     else if (Depatures is IEnumerable <TEntity> )
     {
         Tickets.Load();
         Flights.Load();
         Pilots.Load();
         Stewardesses.Load();
         Crew.Load();
         Types.Load();
         Planes.Load();
         return(Depatures as DbSet <TEntity>);
     }
     else if (Crew is IEnumerable <TEntity> )
     {
         Pilots.Load();
         Stewardesses.Load();
         return(Crew as DbSet <TEntity>);
     }
     else if (Stewardesses is IEnumerable <TEntity> )
     {
         return(Stewardesses as DbSet <TEntity>);
     }
     else if (Pilots is IEnumerable <TEntity> )
     {
         return(Pilots as DbSet <TEntity>);
     }
     else if (Planes is IEnumerable <TEntity> )
     {
         Types.Load();
         return(Planes as DbSet <TEntity>);
     }
     else if (Types is IEnumerable <TEntity> )
     {
         return(Types as DbSet <TEntity>);
     }
     else
     {
         Flights.Load();
         return(Tickets as DbSet <TEntity>);
     }
 }