public ICard SaveCard(IUserSession session, ICard newCard)
        {
            CardEffect effect = new CardEffect
            {
                Affected = (int)newCard.Effect.Affected,
                CardAttackChange = newCard.Effect.CardAttackChange,
                CardAttackMultiplier = newCard.Effect.CardAttackMultiplier,
                Description = newCard.Effect.Description,
                DisableOpponentEffect = newCard.Effect.DisableOpponentEffect,
                EffectTiming = (int)newCard.Effect.EffectTiming,
                LifePointsChange = newCard.Effect.LifePointsChange,
                Name = newCard.Effect.Name,
                ProbabilityOfEffect = newCard.Effect.ProbabilityOfEffect
            };

            Card created = new Card
            {
                Name = newCard.Name,
                ImageUrl = newCard.ImageUrl,
                Effect = effect,
                AttackPoints = newCard.AttackPoints,
                DefensePoints = newCard.DefensePoints
            };

            RequestContext.Model<Entities>().AddToCards(created);
            RequestContext.Model<Entities>().SaveChanges();

            return created;
        }
 partial void OnEffectChanging(CardEffect value);
 /// <summary>
 /// Create a new Card object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="effect">Initial value of the Effect property.</param>
 public static Card CreateCard(global::System.Int32 id, global::System.String name, CardEffect effect)
 {
     Card card = new Card();
     card.Id = id;
     card.Name = name;
     card.Effect = StructuralObject.VerifyComplexObjectIsNotNull(effect, "Effect");
     return card;
 }