/// <summary> /// delete card /// </summary> /// <param name="card"></param> public void DeleteCard(Card card) { var matchedCard = context.Cards.First(c => c.CardId == card.CardId); if (matchedCard != null) { context.Cards.DeleteObject(card); context.SaveChanges(); } }
public void TestInsertCard() { Card card = new Card { Name = "TestCard" }; cardRepository.InsertCard(card); }
public CardDetailViewModel(Types.DetialViewType viewType, Card card) : this(viewType) { selectedCard = card; buyPrice = card.BuyPrice; sellPrice = card.SellPrice; maxPrice = card.MaxPrice; buyPercent = card.BuyPercent; sellPercent = card.SellPercent; excessivePercent = card.ExcessivePercent; maxPriceModifierPercent = card.MaxPriceModifierPercent; //password = card.Password; //securityQuestion = card.SecurityQuestion; }
/// <summary> /// Create a new Card object. /// </summary> /// <param name="cardId">Initial value of the CardId property.</param> /// <param name="cardTypeId">Initial value of the CardTypeId property.</param> public static Card CreateCard(global::System.Int32 cardId, global::System.Int32 cardTypeId) { Card card = new Card(); card.CardId = cardId; card.CardTypeId = cardTypeId; return card; }
/// <summary> /// Deprecated Method for adding a new object to the Cards EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToCards(Card card) { base.AddObject("Cards", card); }
/// <summary> /// insert card /// </summary> /// <param name="card"></param> public void InsertCard(Card card) { context.Cards.AddObject(card); context.SaveChanges(); }
/// <summary> /// update card /// </summary> /// <param name="card"></param> public void UpdateCard(Card card) { var matchedCard = context.Cards.First(c => c.CardId == card.CardId); matchedCard = card; context.SaveChanges(); }