public void Bind(PropertyInfo property, IBindingContext context)
        {
            Type entityType = property.PropertyType.GetGenericArguments()[0];

            // If there is no Extends<> for the entity type, do nothing
            if (!ExtensionProperties.HasExtensionFor(entityType))
            {
                return;
            }

            Type extensionType = ExtensionProperties.ExtensionFor(entityType);

            // direct the FubuMVC model binding to resolve an object of the
            // extensionType using "entityType.Name" as the prefix on the form data,
            // and place the newly created object using the specified property
            context.BindChild(property, extensionType, entityType.Name);
        }
        public void Bind(PropertyInfo property, IBindingContext context)
        {
            if (context.Object == null) return;

            Type entityType = context.Object.GetTrueType();

            // If there is no Extends<> for the entity type, do nothing
            if (!ExtensionProperties.HasExtensionFor(entityType))
            {
                return;
            }

            Type extensionType = ExtensionProperties.ExtensionFor(entityType);

            // direct the FubuMVC model binding to resolve an object of the
            // extensionType using "entityType.Name" as the prefix on the form data,
            // and place the newly created object using the specified property
            context.BindChild(property, extensionType, string.Empty);
        }
Beispiel #3
0
        public void Bind(PropertyInfo property, IBindingContext context)
        {
            if (context.Object == null)
            {
                return;
            }

            Type entityType = context.Object.GetTrueType();

            // If there is no Extends<> for the entity type, do nothing
            if (!ExtensionProperties.HasExtensionFor(entityType))
            {
                return;
            }

            Type extensionType = ExtensionProperties.ExtensionFor(entityType);

            // direct the FubuMVC model binding to resolve an object of the
            // extensionType using "entityType.Name" as the prefix on the form data,
            // and place the newly created object using the specified property
            context.BindChild(property, extensionType, string.Empty);
        }
 public void Bind(PropertyInfo property, IBindingContext context)
 {
     context.BindChild(property);
 }
 public void Bind(PropertyInfo property, IBindingContext context)
 {
     context.BindChild(property);
 }