Exemplo n.º 1
0
 /// <summary>
 /// Creates an <see cref="BasicPropertyAccessor.BasicGetter"/> to <c>get</c> the value from the Property.
 /// </summary>
 /// <param name="type">The <see cref="System.Type"/> to find the Property in.</param>
 /// <param name="propertyName">The name of the mapped Property to get.</param>
 /// <returns>
 /// The <see cref="BasicPropertyAccessor.BasicGetter"/> to use to get the value of the Property from an
 /// instance of the <see cref="System.Type"/>.</returns>
 /// <exception cref="PropertyNotFoundException" >
 /// Thrown when a Property specified by the <c>propertyName</c> could not
 /// be found in the <see cref="System.Type"/>.
 /// </exception>
 public IGetter GetGetter(System.Type type, string propertyName)
 {
     BasicPropertyAccessor.BasicGetter result = BasicPropertyAccessor.GetGetterOrNull(type, propertyName);
     if (result == null)
     {
         throw new PropertyNotFoundException(type, propertyName, "getter");
     }
     return(result);
 }
        protected DocumentMap <T> ContainedIn(Expression <Func <T, object> > property)
        {
            var propertyInfo = property.ToPropertyInfo();
            var getter       = new BasicPropertyAccessor.BasicGetter(typeof(T), propertyInfo, propertyInfo.Name);
            var mapping      = new ContainedInMapping(getter);

            //this.containedInParts.Add(mapping);

            return(this);
        }
Exemplo n.º 3
0
 public EmbeddedPart(PropertyInfo propertyInfo)
 {
     this.embeddedType = propertyInfo.PropertyType;
     this.getter       = new BasicPropertyAccessor.BasicGetter(propertyInfo.DeclaringType, propertyInfo, propertyInfo.Name);
 }