Beispiel #1
0
        public Type?GetPreferredType(Type targetType)
        {
            var res = GetPreferredType();

            if (res == targetType || res == null)
            {
                return(res);
            }
            res = DBObjectFieldHandler.Unwrap(res);
            if (res == DBObjectFieldHandler.Unwrap(targetType))
            {
                return(targetType);
            }
            return(res);
        }
 public override bool TypeSupported(Type type)
 {
     if (ODBDictionaryFieldHandler.IsCompatibleWithStatic(type, FieldHandlerOptions.None))
     {
         return(true);
     }
     if (base.TypeSupported(type))
     {
         return(true);
     }
     if (DBObjectFieldHandler.IsCompatibleWith(type))
     {
         return(true);
     }
     return(false);
 }
        public override IFieldHandler CreateFromType(Type type, FieldHandlerOptions options)
        {
            if (ODBDictionaryFieldHandler.IsCompatibleWithStatic(type, options))
            {
                return(new ODBDictionaryFieldHandler(_odb, type, false, this));
            }
            var result = base.CreateFromType(type, options);

            if (result != null)
            {
                return(result);
            }
            if (DBObjectFieldHandler.IsCompatibleWith(type))
            {
                return(new DBObjectFieldHandler(_odb, type));
            }
            return(null);
        }