/// <summary>
        /// Gets an optionset value from an entity
        /// </summary>
        /// <param name="entity">Name of the entity (Constants.ENTITYNAME.This)</param>
        /// <param name="field">Name of the entity field </param>
        /// <param name="property">OptionSet</param>
        /// <param name="service"></param>
        /// <returns></returns>
        static public object getEntityValue(this Entity entity, string field, string property, IOrganizationService service)
        {
            if (entity != null && !entity.Contains(field))
            {
                return(null);
            }

            ColumnSet colSet = new ColumnSet(property);

            Entity childEntity = Retrieve.GetEntity((EntityReference)entity[field], service, colSet);

            object propertyValue = null;

            if (childEntity != null && childEntity.Contains(property))
            {
                propertyValue = childEntity[property];
            }

            return(propertyValue);
        }
 /// <summary>
 /// Get entity by the EntityId
 /// </summary>
 /// <param name="Entity">Name of the entity (Constants.ENTITYNAME.This)</param>
 /// <param name="service"></param>
 /// <param name="columnSet"></param>
 /// <returns></returns>
 static public Entity GetEntity(this Entity Entity, IOrganizationService service, ColumnSet columnSet)
 {
     return(Retrieve.GetEntity(service, Entity.LogicalName, Entity.LogicalName + "id", Entity.Id, columnSet));
 }