public void SetValue(DomainEntityType source) { if (source.HasAttributes(EnumAttributes.filter)) { return; } _refFilter.SetAttribute(source); }
public void SetValue(DomainEntityType source , IDomainActionFilter filter , IEnumerable <IFilterKeyPair> filters) { if (_refFilter == null) { _refFilter = filter; } _refFilter.SetAttribute(source, filters); }
/// <summary> /// /// </summary> /// <typeparam name="THandler"></typeparam> /// <param name="Handler"></param> /// <param name="EntityType"></param> /// <param name="propName"></param> /// <returns></returns> public static void SetPropValues <THandler>(this THandler Handler, DomainEntityType EntityType, string propName) where THandler : IServiceHandler { List <IEntity> resList = new List <IEntity>(((dynamic)Handler).Get()); //foreach (var res in (((dynamic)Handler).Get())) //{ // resList.Add(res as IBaseEntity); //} resList.AsQueryable().SetPropValues(EntityType, propName); }
/// <summary> /// /// </summary> /// <typeparam name="T"></typeparam> /// <param name="propValues"></param> /// <param name="Entity"></param> /// <param name="propName"></param> public static void SetPropValues <T>(this IQueryable <T> propValues , DomainEntityType Entity , string propName //PropKeyPairFieldDef propKeyPair ) where T : class, IEntity // BaseEntity<T> { if (Entity.Attributes == null) { Entity.Attributes = new ExpandoObject(); } var propList = new List <PropListKeyPair>(); foreach (var fil in propValues) { var value = default(dynamic); var key = fil .GetType() .GetProperty("Id") .GetValue(fil, null); var prop = fil .GetType() .GetProperty(propName); if (typeof(DomainEntityType).IsAssignableFrom(prop.PropertyType)) { value = ((dynamic)prop .GetValue(fil, null)).Value; } else { value = prop .GetValue(fil, null); } propList.Add( new PropListKeyPair() { Key = key.ToString() , Value = value } ); } dynamic attr = new ExpandoObject(); ((IDictionary <String, Object>)Entity.Attributes)["propList"] = propList; }
public static bool SetValue(this IEnumerable <IFilterKeyPair> filterValues , DomainEntityType Entity) { if (filterValues == null) { return(false); } var filterKeyPair = GetServiceType <IFilterKeyPair>() as IFilterKeyPair; var actionFilter = GetServiceType <IDomainActionFilter>(); filterKeyPair.SetValue(Entity, actionFilter, filterValues); return(true); }
public override IEnumerable <string> GetValue(DomainEntityType Entity) { throw new System.NotImplementedException(); }
public IEnumerable <IFilterKeyPair> GetFilterValues(DomainEntityType source) { SetValue(source); return(source.Attributes.Filter.Filters); }
public void SetAttribute(DomainEntityType source, IEnumerable <IFilterKeyPair> filters) { throw new NotImplementedException(); }
public void SetAttribute(DomainEntityType source) { throw new NotImplementedException(); }
public static IEnumerable <IFilterKeyPair> GetValue(this IFilterKeyPair filter , DomainEntityType Entity) { return(filter.GetFilterValues(Entity)); }
public abstract IEnumerable <string> GetValue(DomainEntityType Entity);