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(); } }
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; } }
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; } }
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; } }
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; } }
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; } }