protected DelegatePropertyInfoMember(PropertyInfo propertyInformation) { Guard.AgainstNullReference(propertyInformation, "propertyInformation"); this._getter = TypeMembersHelper.CreatePropertyGetter <TAccessor, TValue>(propertyInformation); this._setter = TypeMembersHelper.CreatePropertySetter <TAccessor, TValue>(propertyInformation); }
/// <summary> /// Creates an instance of <see cref="PropertyRule{TEntity,TProperty}"/> /// </summary> /// <param name="property">The property information to use</param> public PropertyRule(PropertyInfo property) { this._propertyType = typeof(TProperty); this._instanceType = typeof(TInstance); this._propertyName = property.Name; this._propertyAccessor = TypeMembersHelper.CreatePropertyGetter <TInstance, TProperty>(property); this._validationBlocks.AddFirst(new ValidationBlock <TProperty>()); }
/// <summary> /// Creates an instance of <see cref="DelegateFieldInfoMember{TAccessor,TValue}"/> /// /// /// <exception cref="MetadataBuilderException"></exception> /// /// </summary> /// <param name="fieldInformation">The instance that represents a field information via .Net reflection mechanism</param> protected DelegateFieldInfoMember(FieldInfo fieldInformation) { Guard.AgainstNullReference <MetadataBuilderException>(fieldInformation, "fieldInformation"); this._getter = TypeMembersHelper.CreateFieldGetter <TAccessor, TValue>(fieldInformation); this._setter = TypeMembersHelper.CreateFieldSetter <TAccessor, TValue>(fieldInformation); this._memberType = fieldInformation.FieldType; }