コード例 #1
0
        public IEnumerable <IConceptInfo> CreateNewConcepts(IEnumerable <IConceptInfo> existingConcepts)
        {
            var newConcepts = new List <IConceptInfo>();

            DslUtility.ValidatePropertyListSyntax(KeyProperties, this);

            newConcepts.AddRange(KeyProperties.Split(' ').Select <string, IConceptInfo>(propertyName =>
            {
                if (propertyName == "ID")
                {
                    return new KeyPropertyIDComputedFromInfo
                    {
                        EntityComputedFrom = new EntityComputedFromInfo {
                            Target = Persisted
                        }
                    }
                }
                ;
                else
                {
                    return new KeyPropertyComputedFromInfo
                    {
                        PropertyComputedFrom = new PropertyComputedFromInfo
                        {
                            Target = new PropertyInfo {
                                Name = propertyName, DataStructure = Persisted
                            }
                        }
                    }
                };
            }));

            return(newConcepts);
        }
コード例 #2
0
        public void CheckSemantics(IDslModel existingConcepts)
        {
            if (!IsSupported(DataStructure))
            {
                throw new DslSyntaxException(this,
                                             $"SQL index can only be used in a writable data structure." +
                                             $" '{DataStructure.FullName}' is a '{DataStructure.GetKeywordOrTypeName()}'.");
            }

            DslUtility.ValidatePropertyListSyntax(PropertyNames, this);
        }
コード例 #3
0
        public void CheckSemantics(IEnumerable <IConceptInfo> concepts)
        {
            if (!IsSupported(DataStructure))
            {
                throw new DslSyntaxException(
                          string.Format("{0} must be used inside writable data structure. DateStructure {1} is of type {2}.",
                                        this.GetUserDescription(),
                                        DataStructure,
                                        DataStructure.GetType().FullName));
            }

            DslUtility.ValidatePropertyListSyntax(PropertyNames, this);
        }
コード例 #4
0
        public IEnumerable <IConceptInfo> CreateNewConcepts(ComputedFromKeyPropertiesInfo conceptInfo, IDslModel existingConcepts)
        {
            DslUtility.ValidatePropertyListSyntax(conceptInfo.KeyProperties, conceptInfo);

            var keyProperties = conceptInfo.CreateKeyProperties(existingConcepts);

            // If *not all* listed property names are found in the DSL model, wait for more iterations of macro evaluation,
            // or return an error in the IValidatedConcept implementation above.
            if (!keyProperties.Values.All(kp => kp != null))
            {
                return(null);
            }
            else
            {
                return(keyProperties.Values);
            }
        }
コード例 #5
0
        public void CheckSemantics(IEnumerable <IConceptInfo> concepts)
        {
            CheckIfSupported(DataStructure, this);

            DslUtility.ValidatePropertyListSyntax(PropertyNames, this);
        }
コード例 #6
0
 public void CheckSemantics(IDslModel existingConcepts)
 {
     DslUtility.ValidatePropertyListSyntax(ExceptProperties, this);
 }
コード例 #7
0
 public void CheckSemantics(IEnumerable <IConceptInfo> existingConcepts)
 {
     DslUtility.ValidatePropertyListSyntax(ExceptProperties, this);
 }