protected override bool CanMap(PreCompileArgument arg)
        {
            if (!arg.DestinationType.IsRecordType())
            {
                return(false);
            }

            return(true);
        }
Example #2
0
        protected override bool CanMap(PreCompileArgument arg)
        {
            if (!arg.SourceType.IsCollection() || !arg.DestinationType.IsCollection())
            {
                return(false);
            }
            if (arg.DestinationType.IsListCompatible())
            {
                return(true);
            }

            return(arg.DestinationType.GetDictionaryType() != null);
        }
Example #3
0
        protected override bool CanMap(PreCompileArgument arg)
        {
            var bindingFlags = arg.ExplicitMapping
                ? BindingFlags.Public | BindingFlags.NonPublic
                : BindingFlags.Public;

            if (!arg.DestinationType.IsPoco(bindingFlags))
            {
                return(false);
            }

            return(true);
        }
Example #4
0
        protected override bool CanMap(PreCompileArgument arg)
        {
            if (!arg.DestinationType.GetTypeInfo().IsGenericType ||
                !_immutableTypes.ContainsKey(arg.DestinationType.GetGenericTypeDefinition()))
            {
                return(false);
            }

            var args = arg.DestinationType.GetGenericArguments();

            if (args.Length == 2 && args[0] == typeof(string))
            {
                return(true);
            }
            return(IsCollection(arg.SourceType));
        }
Example #5
0
 protected override bool CanMap(PreCompileArgument arg)
 {
     return(true);
 }
 protected override bool CanMap(PreCompileArgument arg)
 {
     return(arg.SourceType.IsCollection() &&
            arg.DestinationType.IsCollection() &&
            arg.DestinationType.IsListCompatible());
 }
Example #7
0
        protected override int Score => - 110;   //must do before all class adapters

        protected override bool CanMap(PreCompileArgument arg)
        {
            return(arg.SourceType == typeof(string) || arg.DestinationType == typeof(string));
        }
Example #8
0
 protected override bool CanMap(PreCompileArgument arg)
 {
     return(arg.ExplicitMapping || arg.DestinationType.IsPoco());
 }
Example #9
0
        protected override int Score => DefaultScore;   //must do before CollectionAdapter

        protected override bool CanMap(PreCompileArgument arg)
        {
            var dictType = arg.DestinationType.GetDictionaryType();

            return(dictType?.GetGenericArguments()[0] == typeof(string));
        }
 protected override bool CanMap(PreCompileArgument arg)
 {
     throw new NotImplementedException();
 }
Example #11
0
 public virtual int?Priority(PreCompileArgument arg)
 {
     return(CanMap(arg) ? this.Score : (int?)null);
 }
Example #12
0
 protected abstract bool CanMap(PreCompileArgument arg);
Example #13
0
 protected override bool CanMap(PreCompileArgument arg)
 {
     return(typeof(JToken).IsAssignableFrom(arg.SourceType) ||
            typeof(JToken).IsAssignableFrom(arg.DestinationType));
 }
Example #14
0
 protected override bool CanMap(PreCompileArgument arg)
 {
     return(arg.SourceType.GetTypeInfo().IsEnum || arg.DestinationType.GetTypeInfo().IsEnum);
 }
 protected override bool CanMap(PreCompileArgument arg)
 {
     return(arg.SourceType.IsCollection() &&
            arg.DestinationType.IsArray &&
            arg.DestinationType.GetArrayRank() > 1);
 }
Example #16
0
 protected override bool CanMap(PreCompileArgument arg)
 {
     return(arg.DestinationType.IsRecordType());
 }
Example #17
0
        protected override int Score => - 109;   //must do before StringAdapter

        protected override bool CanMap(PreCompileArgument arg)
        {
            return(CanMap(arg.SourceType, arg.DestinationType) ||
                   CanMap(arg.DestinationType, arg.SourceType));
        }