예제 #1
0
 protected PropertyBaseMapping(ITableMappingCache cache, IColumnMapping foreignKey, string joinOn, PropertyInfo info)
 {
     Name              = info.Name;
     JoinOnFieldName   = joinOn;
     ForeignKeyColumn  = foreignKey;
     TableMappingCache = cache;
 }
예제 #2
0
 /// <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
     }
 }
예제 #3
0
 /// <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());
 }