Exemplo n.º 1
0
 public static IList<Card> SaveCards(IEnumerable<Card> cards)
 {
   using (ICardRepository cardRepository = new CardRepository())
   {
     cardRepository.AttachEntityIfChangeTrackingDisabled(cardRepository.ObjectContext.Cards, cards);
     cardRepository.ApplyChanges(cardRepository.ObjectContext.Cards, cards);
     cardRepository.UnitOfWork.SaveChanges();
     cardRepository.ObjectContext.AcceptAllChanges();
     return cards.ToList();
   }
 }
Exemplo n.º 2
0
 public static CardGroupMap SaveCardGroupMap(CardGroupMap map)
 {
   using (ICardRepository cardRepository = new CardRepository())
   {
     cardRepository.AttachEntityIfChangeTrackingDisabled(cardRepository.ObjectContext.CardGroupMaps, map);
     cardRepository.ApplyChanges(cardRepository.ObjectContext.CardGroupMaps, map);
     cardRepository.UnitOfWork.SaveChanges();
     map.AcceptChanges();
     return map;
   }  
 }
Exemplo n.º 3
0
 public static SoftwareEncoder SaveSoftwareEncoder(SoftwareEncoder encoder)
 {
   using (ICardRepository cardRepository = new CardRepository())
   {
     cardRepository.AttachEntityIfChangeTrackingDisabled(cardRepository.ObjectContext.SoftwareEncoders, encoder);
     cardRepository.ApplyChanges(cardRepository.ObjectContext.SoftwareEncoders, encoder);
     cardRepository.UnitOfWork.SaveChanges();
     encoder.AcceptChanges();
     return encoder;
   }  
 }
Exemplo n.º 4
0
 public static Satellite SaveSatellite(Satellite satellite)
 {
   using (ICardRepository cardRepository = new CardRepository())
   {
     cardRepository.AttachEntityIfChangeTrackingDisabled(cardRepository.ObjectContext.Satellites, satellite);
     cardRepository.ApplyChanges(cardRepository.ObjectContext.Satellites, satellite);
     cardRepository.UnitOfWork.SaveChanges();
     satellite.AcceptChanges();
     return satellite;
   }  
 }
Exemplo n.º 5
0
 public static DisEqcMotor SaveDisEqcMotor(DisEqcMotor motor)
 {
   using (ICardRepository cardRepository = new CardRepository())
   {
     cardRepository.AttachEntityIfChangeTrackingDisabled(cardRepository.ObjectContext.DisEqcMotors, motor);
     cardRepository.ApplyChanges(cardRepository.ObjectContext.DisEqcMotors, motor);
     cardRepository.UnitOfWork.SaveChanges();
     motor.AcceptChanges();
     return motor;
   }  
 }
Exemplo n.º 6
0
 public static Card SaveCard(Card card)
 {
   using (ICardRepository cardRepository = new CardRepository())
   {
     cardRepository.AttachEntityIfChangeTrackingDisabled(cardRepository.ObjectContext.Cards, card);
     cardRepository.ApplyChanges(cardRepository.ObjectContext.Cards, card);
     cardRepository.UnitOfWork.SaveChanges();
     card.AcceptChanges();
     return card;
   }    
 }