Exemple #1
0
 public PropertyBuilder(IFuncDictionary <Type, MemberInfo> propertyDataAttributeFuncDictionary,
                        IFuncList <string, string> customPropertyDataFuncDictionary,
                        IDictionary <string, string> csdlTypeDictionary)
 {
     _PropertyDataAttributeDictionary = propertyDataAttributeFuncDictionary;
     _CustomPropertyDataFuncs         = customPropertyDataFuncDictionary;
     _CsdlTypeDictionary = csdlTypeDictionary;
 }
Exemple #2
0
 public EntityBuilder(ICsdlBuilder <PropertyInfo, CsdlProperty> propertyBuilder,
                      ICsdlBuilder <PropertyInfo, CsdlEnumProperty> enumPropertyBuilder,
                      IFuncDictionary <Type, MemberInfo> entityAttributeFuncDictionary,
                      IFuncDictionary <Type, MemberInfo> propertyAttributeFuncDictionary,
                      IFuncList <string> customPropertyFuncs
                      )
 {
     _PropertyBuilder                 = propertyBuilder;
     _EnumPropertyBuilder             = enumPropertyBuilder;
     _EntityAttributeFuncDictionary   = entityAttributeFuncDictionary;
     _PropertyAttributeFuncDictionary = propertyAttributeFuncDictionary;
     _CustomPropertyFuncs             = customPropertyFuncs;
 }
Exemple #3
0
        public void DictionaryExtensions_AddFromCustomDictionary_FuncsNull_Test()
        {
            // Arrange
            var dictionary = new Dictionary <string, object>();
            var entity     = "Entity1";
            var prop       = "Prop1";
            IFuncList <string, string> funcs = null;

            // Act
            dictionary.AddFromCustomDictionary(entity, prop, funcs);

            // Assert
            Assert.AreEqual(0, dictionary.Count);
        }
Exemple #4
0
 public CsdlBuilderFactory(IFuncDictionary <Type, MemberInfo> propertyDataAttributeDictionary,
                           IFuncDictionary <Type, MemberInfo> entityAttributeDictionary,
                           IFuncDictionary <Type, MemberInfo> propertyAttributeDictionary,
                           IFuncList <string> customPropertyFuncs,
                           IFuncList <string, string> customPropertyDataFuncs,
                           IDictionary <string, string> csdlTypeDictionary
                           )
 {
     PropertyDataAttributeDictionary = propertyDataAttributeDictionary;
     EntityAttributeDictionary       = entityAttributeDictionary;
     PropertyAttributeDictionary     = propertyAttributeDictionary;
     CustomPropertyFuncs             = customPropertyFuncs;
     CustomPropertyDataFuncs         = customPropertyDataFuncs;
     CsdlTypeDictionary = csdlTypeDictionary;
 }
Exemple #5
0
 public RelatedEntityMappingNavigationPropertyBuilder(IFuncList <string, string> CustomPropertyDataFuncs)
 {
     _CustomPropertyDataFuncs = CustomPropertyDataFuncs;
 }
Exemple #6
0
 internal static void AddFromCustomDictionary(this IDictionary <string, object> dictionary, string entity, string property, IFuncList <string, string> customPropertyDataFuncs)
 {
     if (dictionary == null ||
         string.IsNullOrWhiteSpace(entity) ||
         string.IsNullOrWhiteSpace(property) ||
         customPropertyDataFuncs == null ||
         !customPropertyDataFuncs.Any())
     {
         return;
     }
     foreach (var func in customPropertyDataFuncs)
     {
         var items = func(entity, property);
         if (items != null && items.Any())
         {
             dictionary.AddRange(items);
         }
     }
 }
Exemple #7
0
 public CsdlBuilderFactory(IFuncList <string> customPropertyFuncs)
 {
     CustomPropertyFuncs = customPropertyFuncs;
 }