Beispiel #1
0
 public SchemaBuilder AddTypeConverters(IEnumerable <ITypeConverter> typeConverters)
 {
     ClassToEntityRules.Add(
         new TypeConverterRule <ViewIntersectionModel, ViewIntersectionField, EntityModel, EntityField>(typeConverters)
         );
     EntityToTypeRules.Add(
         new TypeConverterRule <EntityModel, EntityField, TypeModel, PropertyInfoField>(typeConverters)
         );
     return(this);
 }
Beispiel #2
0
        public SchemaBuilder()
        {
            AddMethodConverter(
                typeof(Enum).GetMethod(nameof(Enum.HasFlag)), new HasFlagCallConverter()
                );
            AddMethodConverter(
                typeof(DatabaseFunctions).GetMethod(nameof(DatabaseFunctions.Like)), new StringLikeCallConverter()
                );
            AddMethodConverter(
                typeof(DatabaseFunctions).GetMethod(nameof(DatabaseFunctions.Alias)), new AliasCallConverter()
                );
            AddMethodConverter(
                typeof(DatabaseFunctions).GetMethod(nameof(DatabaseFunctions.Count)), new CountCallConverter()
                );
            AddMethodConverter(
                typeof(DatabaseFunctions).GetMethod(nameof(DatabaseFunctions.Random)), new RandomCallConverter()
                );
            AddMethodConverter(
                typeof(DatabaseFunctions).GetMethod(nameof(DatabaseFunctions.IsIn)), new IsInCallConverter()
                );
            AddMinMethods();
            AddMaxMethods();

            EntityToTypeCandidateSources.AddRange(
                GetDefaultCandidateSources <EntityModel, EntityField, TypeModel, PropertyInfoField>()
                );
            ClassToEntityCandidateSources.AddRange(
                GetDefaultCandidateSources <ViewIntersectionModel, ViewIntersectionField, EntityModel, EntityField>()
                );

            EntityToTypeRules.AddRange(
                GetDefaultRules <EntityModel, EntityField, TypeModel, PropertyInfoField>()
                );
            ClassToEntityRules.AddRange(
                GetDefaultRules <ViewIntersectionModel, ViewIntersectionField, EntityModel, EntityField>()
                );
        }