public BindingPathConfiguration <TTargetType> HasManyPath <TTargetType>( Expression <Func <TStructuralType, IEnumerable <TTargetType> > > pathExpression, bool contained) where TTargetType : class { if (pathExpression == null) { throw Error.ArgumentNull("pathExpression"); } PropertyInfo pathProperty = PropertySelectorVisitor.GetSelectedProperty(pathExpression); IList <MemberInfo> bindingPath = new List <MemberInfo>(_bindingPath); bindingPath.Add(pathProperty); StructuralTypeConfiguration <TTargetType> target; if (contained) { target = _modelBuilder.EntityType <TTargetType>(); _structuralType.ContainsMany(pathExpression); // add a containment navigation property } else { target = _modelBuilder.ComplexType <TTargetType>(); _structuralType.CollectionProperty(pathExpression); // add a collection complex property } return(new BindingPathConfiguration <TTargetType>(_modelBuilder, target, _navigationSource, bindingPath)); }
public ComplexTypeConfiguration <TComplexType> DerivesFrom <TBaseType>() where TBaseType : class { ComplexTypeConfiguration <TBaseType> baseEntityType = _modelBuilder.ComplexType <TBaseType>(); _configuration.DerivesFrom(baseEntityType._configuration); return(this); }