Ejemplo n.º 1
0
        /// <summary>
        /// 获取实体的属性值。
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="propertyName"></param>
        /// <returns></returns>
        private PropertyValue GetEntityValue(IEntity entity, string propertyName)
        {
            //级联属性
            if (propertyName.IndexOf('.') != -1)
            {
                PropertyValue pvalue = null;
                object        value  = null;
                foreach (var p in propertyName.Split('.'))
                {
                    pvalue = entity.GetValue(p);
                    if (!pvalue.IsEmpty)
                    {
                        value = pvalue.GetStorageValue();
                        if (value is IEntity)
                        {
                            entity = (IEntity)value;
                        }
                        else
                        {
                            return(pvalue);
                        }
                    }
                }
            }

            return(entity.GetValue(propertyName));
        }
Ejemplo n.º 2
0
 internal EntityQueryBuilder Or(IProperty property, PropertyValue value, QueryOperator oper = QueryOperator.Equals)
 {
     return(Or(property, value.GetStorageValue(), oper));
 }