private EntityDTOCollection HydrateEntityDTO(EntityCollection entityCollection)
        {
            EntityDTOCollection tempCollection = new EntityDTOCollection();

            if (entityCollection != null && entityCollection.Count > 0)
            {
                foreach (Entity item in entityCollection)
                {
                    if (!string.IsNullOrEmpty(item.EntityName))
                    {
                        EntityDTO temp = new EntityDTO()
                        {
                            EntityId = item.EntityId, EntityName = item.EntityName
                        };

                        if (!string.IsNullOrEmpty(item.DisplayName))
                        {
                            temp.DisplayName = item.DisplayName;
                        }

                        tempCollection.Add(temp);
                    }
                    else
                    {
                        tempCollection.Add(new EntityDTO {
                            EntityId = item.EntityId
                        });
                    }
                }
            }
            return(tempCollection);
        }
        private EntityDTOCollection HydrateEntityDTO(EntityCollection entityCollection)
        {
            EntityDTOCollection tempCollection = new EntityDTOCollection();

            if (entityCollection != null && entityCollection.Count() > 0)
            {
                foreach (Entity item in entityCollection)
                {
                    if (!string.IsNullOrEmpty(item.EntityName))
                        tempCollection.Add(new EntityDTO { EntityId = item.EntityId, entityName = item.EntityName });
                    else
                        tempCollection.Add(new EntityDTO { EntityId = item.EntityId });
                }
            }
            return tempCollection;
        }