예제 #1
0
        public void CheckSemantics(IDslModel existingConcepts)
        {
            if (!(Subtype is IOrmDataStructure))
            {
                throw new DslSyntaxException(this, "Is (polymorphic) may only be used on a database-mapped data structure, such as Entity or SqlQueryable. "
                                             + this.Subtype.GetUserDescription() + " is not IOrmDataStructure.");
            }

            if (ImplementationName == null)
            {
                throw new DslSyntaxException(this, "ImplementationName must not be null. It is allowed to be an empty string.");
            }

            if (!string.IsNullOrEmpty(ImplementationName))
            {
                DslUtility.ValidateIdentifier(ImplementationName, this, "Invalid ImplementationName value.");
            }

            if (existingConcepts.FindByReference <PolymorphicMaterializedInfo>(pm => pm.Polymorphic, Supertype).Any())
            {
                // Verifying if the ChangesOnChangedItemsInfo can be created (see IsSubtypeOfMacro)
                var dependsOn = DslUtility.GetBaseChangesOnDependency(Subtype, existingConcepts);
                if (dependsOn.Count() == 0)
                {
                    throw new DslSyntaxException(this, Subtype.GetUserDescription() + " should be an *extension* of an entity. Otherwise it cannot be used in a materialized polymorphic entity because the system cannot detect when to update the persisted data.");
                }
            }
        }
 public void CheckSemantics(IDslModel existingConcepts)
 {
     DslUtility.ValidateIdentifier(Name, this);
 }
예제 #3
0
 public void CheckSemantics(IDslModel existingConcepts)
 {
     DslUtility.ValidateIdentifier(BaseSelector, this, "BaseSelector should be set to a property name from '"
                                   + DerivedProperty.DataStructure.GetKeyProperties() + "' class.");
 }
 public void CheckSemantics(IDslModel existingConcepts)
 {
     DslUtility.ValidatePath(Browse.Source, Path, existingConcepts, this);
     DslUtility.ValidateIdentifier(Name, this, "Specify a valid name before the path, to override the generated name.");
 }
예제 #5
0
 public void CheckSemantics(IEnumerable <IConceptInfo> existingConcepts)
 {
     DslUtility.ValidateIdentifier(Name, this);
 }
예제 #6
0
 public void CheckSemantics(IDslModel existingConcepts)
 {
     DslUtility.ValidatePath(LoadOldItems.SaveMethod.Entity, Path, existingConcepts, this);
     DslUtility.ValidateIdentifier(GetPropertyName(), this);
 }
예제 #7
0
 public void CheckSemantics(IDslModel existingConcepts)
 {
     DslUtility.ValidateIdentifier(RuleName, this, "Invalid RuleName property value.");
 }