public virtual bool AreEqual(ICharacterFriendModel model, ICharacterFriend entity) { return EntityMapper.AreEqual(model, entity) // CharacterFriend Properties // <None> // Related Objects && model.CharacterId == entity.CharacterId && model.FriendId == entity.FriendId ; }
public virtual void MapToEntity(ICharacterFriendModel model, ref ICharacterFriend entity, int currentDepth = 1) { currentDepth++; // Assign Base properties EntityMapper.MapToEntity(model, ref entity); // CharacterFriend Properties // <None> // Related Objects entity.CharacterId = model.CharacterId; entity.Character = (Character)model.Character?.MapToEntity(); entity.FriendId = model.FriendId; entity.Friend = (Character)model.Friend?.MapToEntity(); // Associated Objects // <None> }
public virtual ICharacterFriendModel MapToModel(ICharacterFriend entity, int currentDepth = 1) { currentDepth++; var model = EntityMapper.MapToModel<ICharacterFriend, CharacterFriendModel>(entity); // CharacterFriend Properties // <None> // Related Objects model.CharacterId = entity.CharacterId; model.Character = entity.Character?.MapToModel(); model.FriendId = entity.FriendId; model.Friend = entity.Friend?.MapToModel(); // Associated Objects // <None> // Return Entity return model; }
public static ICharacterFriendModel MapToModelListing(this ICharacterFriend entity, int currentDepth = 1) { return(Mapper.MapToModelListing(entity, currentDepth)); }
public static void MapToEntity(this ICharacterFriendModel model, ref ICharacterFriend entity, int currentDepth = 1) { Mapper.MapToEntity(model, ref entity, currentDepth); }
public void Update(ICharacterFriend entity) { Context.SetModified(entity); }
public void Remove(ICharacterFriend entity) { Context.CharacterFriends.Remove((CharacterFriend)entity); }
public void Deactivate(ICharacterFriend entity) { entity.Active = false; Update(entity); }
public void Add(ICharacterFriend entity) { Context.CharacterFriends.Add((CharacterFriend)entity); }
public static bool AreEqual(this ICharacterFriendModel model, ICharacterFriend entity) { return Mapper.AreEqual(model, entity); }
protected bool Remove(ICharacterFriend entity) { if (entity == null) { return true; } // No entity found to remove, consider it passed // Remove it CharacterFriendsRepository.Remove(entity); // Try to Save Changes CharacterFriendsRepository.SaveChanges(); // Finished! return true; }
protected bool Deactivate(ICharacterFriend entity) { // Deactivate it CharacterFriendsRepository.Deactivate(entity); // Try to Save Changes CharacterFriendsRepository.SaveChanges(); // Finished! return true; }