Exemple #1
0
        /// <summary>
        /// 得到属性
        /// </summary>
        /// <returns></returns>
        public virtual string GetPropertyUrl(long id, string name, string value)
        {
            if (string.IsNullOrEmpty(value))
            {
                return(null);
            }
            var infos = new List <PropertyEntity>();

            if (ExistSearchProperties != null && ExistSearchProperties.Count > 0)
            {
                if (ExistSearchProperties.FirstOrDefault(it => it.Id == id && it.Value == value) != null)
                {
                    return(null);
                }
                var p = SearchProperties.FirstOrDefault(it => it.Id == id);
                if (p != null && (p.SearchType == PropertySearchType.None || p.SearchType == PropertySearchType.Select))
                {
                    infos.AddRange(ExistSearchProperties.Where(it => it.Id != id));
                }
                else
                {
                    infos.AddRange(ExistSearchProperties);
                }
                infos.Add(new PropertyEntity {
                    Id = id, Name = name, Value = value
                });
            }
            else
            {
                infos.Add(new PropertyEntity {
                    Id = id, Name = name, Value = value
                });
            }
            return(SerializeProperty(infos));
        }