Beispiel #1
0
 protected bool Deactivate(ICharacterPower entity)
 {
     // Deactivate it
     CharacterPowersRepository.Deactivate(entity);
     // Try to Save Changes
     CharacterPowersRepository.SaveChanges();
     // Finished!
     return(true);
 }
 public virtual bool AreEqual(ICharacterPowerModel model, ICharacterPower entity)
 {
     return(EntityMapper.AreEqual(model, entity)
            // CharacterPower Properties
            // <None>
            // Related Objects
            && model.CharacterId == entity.CharacterId &&
            model.PowerId == entity.PowerId
            );
 }
Beispiel #3
0
 protected bool Remove(ICharacterPower entity)
 {
     if (entity == null)
     {
         return(true);
     }                                    // No entity found to remove, consider it passed
     // Remove it
     CharacterPowersRepository.Remove(entity);
     // Try to Save Changes
     CharacterPowersRepository.SaveChanges();
     // Finished!
     return(true);
 }
        public virtual ICharacterPowerModel MapToModelListing(ICharacterPower entity, int currentDepth = 1)
        {
            currentDepth++;
            var model = EntityMapper.MapToModelListing <ICharacterPower, CharacterPowerModel>(entity);

            // CharacterPower Properties
            // <None>
            // Related Objects
            model.CharacterId = entity.CharacterId;
            model.PowerId     = entity.PowerId;
            // Return Entity
            return(model);
        }
 public virtual void MapToEntity(ICharacterPowerModel model, ref ICharacterPower entity, int currentDepth = 1)
 {
     currentDepth++;
     // Assign Base properties
     EntityMapper.MapToEntity(model, ref entity);
     // CharacterPower Properties
     // <None>
     // Related Objects
     entity.CharacterId = model.CharacterId;
     entity.Character   = (Character)model.Character?.MapToEntity();
     entity.PowerId     = model.PowerId;
     entity.Power       = (Power)model.Power?.MapToEntity();
     // Associated Objects
     // <None>
 }
 public void Remove(ICharacterPower entity)
 {
     Context.CharacterPowers.Remove((CharacterPower)entity);
 }
 public void Add(ICharacterPower entity)
 {
     Context.CharacterPowers.Add((CharacterPower)entity);
 }
 protected bool Remove(ICharacterPower entity)
 {
     if (entity == null) { return true; } // No entity found to remove, consider it passed
     // Remove it
     CharacterPowersRepository.Remove(entity);
     // Try to Save Changes
     CharacterPowersRepository.SaveChanges();
     // Finished!
     return true;
 }
 protected bool Deactivate(ICharacterPower entity)
 {
     // Deactivate it
     CharacterPowersRepository.Deactivate(entity);
     // Try to Save Changes
     CharacterPowersRepository.SaveChanges();
     // Finished!
     return true;
 }
 public static bool AreEqual(this ICharacterPowerModel model, ICharacterPower entity)
 {
     return(Mapper.AreEqual(model, entity));
 }
 public static void MapToEntity(this ICharacterPowerModel model, ref ICharacterPower entity, int currentDepth = 1)
 {
     Mapper.MapToEntity(model, ref entity, currentDepth);
 }
 public void Update(ICharacterPower entity)
 {
     Context.SetModified(entity);
 }
 public void Remove(ICharacterPower entity)
 {
     Context.CharacterPowers.Remove((CharacterPower)entity);
 }
 public void Deactivate(ICharacterPower entity)
 {
     entity.Active = false;
     Update(entity);
 }
 public void Add(ICharacterPower entity)
 {
     Context.CharacterPowers.Add((CharacterPower)entity);
 }
 public void Deactivate(ICharacterPower entity)
 {
     entity.Active = false;
     Update(entity);
 }
 public void Update(ICharacterPower entity)
 {
     Context.SetModified(entity);
 }
 public static ICharacterPowerModel MapToModelListing(this ICharacterPower entity, int currentDepth = 1)
 {
     return(Mapper.MapToModelListing(entity, currentDepth));
 }