Exemplo n.º 1
0
        public IEntityTypeBuilder Initialize(SignatureTypeConfiguration config, IBindableModelBuilder modelBuilder, IEntityTypeBuilder publicEntityType)
        {
            var typeBuilder = modelBuilder.CreateEntityTypeBuilder(config.SignatureType)
                              .WithParentType(publicEntityType)
                              .WithStructuralProperty(this.quantityTypeProperty);

            foreach (var signature in this.signatureSetInitializer.GetRelevantSignaturesByType(config.SignatureType))
            {
                var setBuilder = this.signatureSetInitializer.InitializeSet(
                    modelBuilder,
                    typeBuilder,
                    signature,
                    config.RelevantEntityTypes,
                    "ResourceMasterdata");

                IEntitySetBinding existingBinding;
                if (!modelBuilder.TryGetBinding(setBuilder, out existingBinding))
                {
                    throw new InvalidOperationException("No existing bind found for resource entity set.");
                }

                modelBuilder
                .WithBinding(setBuilder, new ResourceEntitySetBinding(this.resourceService, signature, existingBinding))
                .WithDependency(setBuilder, this.quantityTypeProperty)
                .WithOptionalDependency(setBuilder, publicEntityType.KeyProperties.First());
            }

            return(typeBuilder);
        }
        public IEntityTypeBuilder Initialize(
            SignatureTypeConfiguration config,
            IBindableModelBuilder modelBuilder,
            IEntityTypeBuilder publicEntityType)
        {
            var typeBuilder = modelBuilder.CreateEntityTypeBuilder(config.SignatureType).WithParentType(publicEntityType);

            foreach (var signature in this.signatureSetInitializer.GetRelevantSignaturesByType(config.SignatureType))
            {
                this.signatureSetInitializer.InitializeSingleton(
                    modelBuilder, typeBuilder, signature, config.RelevantEntityTypes, "GlobalMasterData");
            }

            return(typeBuilder);
        }
        public IEntityTypeBuilder Initialize(
            SignatureTypeConfiguration config,
            IBindableModelBuilder modelBuilder,
            IEntityTypeBuilder publicEntityType)
        {
            var typeBuilder = modelBuilder.CreateEntityTypeBuilder(config.SignatureType).WithParentType(publicEntityType);

            var versionInfoTypeBuilder = this.versionInfoTypeInitializer.GetOrCreateVersionInfoType(modelBuilder, publicEntityType);

            this.versionInfoTypeInitializer.InitializeVersionsNavigationProperty(modelBuilder, typeBuilder, versionInfoTypeBuilder);

            foreach (var signature in this.signatureSetInitializer.GetRelevantSignaturesByType(config.SignatureType))
            {
                this.signatureSetInitializer.InitializeSet(modelBuilder, typeBuilder, signature, config.RelevantEntityTypes);
            }

            return(typeBuilder);
        }
Exemplo n.º 4
0
        public IEntityTypeBuilder Initialize(
            SignatureTypeConfiguration config,
            IBindableModelBuilder modelBuilder,
            IEntityTypeBuilder publicEntityType)
        {
            var dataTreeTypeBuilder = modelBuilder.CreateEntityTypeBuilder(config.SignatureType).WithParentType(publicEntityType);
            var parentProperty      =
                dataTreeTypeBuilder.CreateUncontainedNavigationProperty(dataTreeTypeBuilder, FactonModelKeywords.TreeNodeParentNavigationPropertyName)
                .WithMultiplicity(EdmMultiplicity.Many, EdmMultiplicity.One)
                .WithSupportedOperations(Operation.Get);

            modelBuilder.WithBinding(parentProperty, new TreeNodeParentNavigationPropertyBinding());

            foreach (var signature in this.signatureSetInitializer.GetRelevantSignaturesByType(config.SignatureType))
            {
                var setBuilder =
                    this.signatureSetInitializer.InitializeSet(
                        modelBuilder, dataTreeTypeBuilder, signature, config.RelevantEntityTypes, this.space)
                    .WithUncontainedNavigationPropertySelfTarget(parentProperty);

                IEntitySetBinding existingBinding;
                if (!modelBuilder.TryGetBinding(setBuilder, out existingBinding))
                {
                    throw new InvalidOperationException("No existing binding found for tree node entity set.");
                }

                modelBuilder
                .WithBinding(setBuilder, new TreeNodeEntitySetBinding(existingBinding))
                .WithDependency(setBuilder, parentProperty)
                .WithOptionalDependency(setBuilder, publicEntityType.KeyProperties.First());

                this.AddTreePropertiesToPublicEntityType(signature, modelBuilder, dataTreeTypeBuilder, publicEntityType);
            }

            return(dataTreeTypeBuilder);
        }
Exemplo n.º 5
0
 public IEntityTypeBuilder Initialize(SignatureTypeConfiguration config, IBindableModelBuilder modelBuilder, IEntityTypeBuilder publicEntityType)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 6
0
 public bool CanHandleSignatureType(SignatureTypeConfiguration config)
 {
     // we don't want to initialize any signature types but only perform post processing.
     return(false);
 }
 public bool CanHandleSignatureType(SignatureTypeConfiguration config)
 {
     return(config.SignatureType == "Global");
 }
Exemplo n.º 8
0
 public void RegisterSignatureTypeConfiguration(SignatureTypeConfiguration supportedFactonSignatureType)
 {
     this.registeredSignatureTypeConfigurations.Add(supportedFactonSignatureType);
 }
Exemplo n.º 9
0
 public bool CanHandleSignatureType(SignatureTypeConfiguration config)
 {
     return(config.SignatureType == "Resource");
 }
Exemplo n.º 10
0
 public bool CanHandleSignatureType(SignatureTypeConfiguration config)
 {
     return(config.SignatureType == this.signatureType);
 }
 public bool CanHandleSignatureType(SignatureTypeConfiguration config)
 {
     return(config.SignatureType == "Calculation" | config.SignatureType == "VariantFolder");
 }