protected PropertyBaseMapping(ITableMappingCache cache, IColumnMapping foreignKey, string joinOn, PropertyInfo info) { Name = info.Name; JoinOnFieldName = joinOn; ForeignKeyColumn = foreignKey; TableMappingCache = cache; }
/// <summary> /// /// </summary> /// <param name="cache"></param> /// <param name="foreignKey"></param> /// <param name="info"></param> /// <param name="name"> Property name </param> public PropertyListMapping(ITableMappingCache cache, IColumnMapping foreignKey, string joinOn, PropertyInfo info) : base(cache, foreignKey, joinOn, info) { try { Getter = (Func <TEntity, ICollection <TProperty> >)Delegate.CreateDelegate(typeof(Func <TEntity, ICollection <TProperty> >), info.GetGetMethod()); Setter = (Action <TEntity, ICollection <TProperty> >)Delegate.CreateDelegate(typeof(Action <TEntity, ICollection <TProperty> >), info.GetSetMethod()); } catch (Exception) { // Hide exception here, the result will be checked later } }
/// <summary> /// /// </summary> /// <param name="cache"></param> /// <param name="foreignKey"></param> /// <param name="info"></param> /// <param name="name"> Property name </param> public PropertyMapping(ITableMappingCache cache, IColumnMapping foreignKey, string joinOn, PropertyInfo info) : base(cache, foreignKey, joinOn, info) { Getter = (Func <TEntity, TProperty>)Delegate.CreateDelegate(typeof(Func <TEntity, TProperty>), info.GetGetMethod()); Setter = (Action <TEntity, TProperty>)Delegate.CreateDelegate(typeof(Action <TEntity, TProperty>), info.GetSetMethod()); }