예제 #1
0
 public static string CantAggregateOverNoncollectionError(MemberMappingDescriptor member, string aggregateFunction)
 {
     StringBuilder error = GetIntro(member);
     error.AppendFormat("Target member '{0}' for '{1}' aggregate function must be an array or a collection.",
         member.Member, aggregateFunction);
     return error.ToString();
 }
예제 #2
0
        public static string CreateStandardErrorMessage(MemberMappingDescriptor member, string message)
        {
            StringBuilder error = GetIntro(member);

            error.Append(message);
            return(error.ToString());
        }
예제 #3
0
        public static string CantAggregateOverUntypedCollections(MemberMappingDescriptor member)
        {
            StringBuilder error = GetIntro(member);

            error.AppendFormat("Aggregate functions can only be used over arrays of generic collections. Nongeneric collections are not supported.");
            return(error.ToString());
        }
예제 #4
0
 public static string EnumValueDoesntExistError(MemberMappingDescriptor member, ProjectionItem item)
 {
     StringBuilder error = GetIntro(member);
     error.AppendFormat("Invalid projection '{0} => {1}'. Value '{1}' is not defined in '{2}' enumeration",
         item.From, item.To, member.Type.FullName);
     return error.ToString();
 }
예제 #5
0
        public static string EmptyToAttributeInXmlError(MemberMappingDescriptor member, string xml)
        {
            StringBuilder error = GetIntro(member);

            error.AppendFormat("Invalid projection. Attribute 'to' in XML projection mapping must not be empty");
            return(error.ToString());
        }
예제 #6
0
        public static string InvalidAggregatePathError(MemberMappingDescriptor member)
        {
            StringBuilder error = GetIntro(member);

            error.AppendFormat("Invalid path for aggregate expression: '{0}'", member.Expression);
            return(error.ToString());
        }
예제 #7
0
        public static string InvalidProjectionStringError(MemberMappingDescriptor member, string projection)
        {
            StringBuilder error = GetIntro(member);

            error.AppendFormat("Invalid projection. Expression '' is not a valid projection string");
            return(error.ToString());
        }
예제 #8
0
 public static string DuplicateProjectionError(MemberMappingDescriptor member, ProjectionItem item, string existingValue)
 {
     StringBuilder error = GetIntro(member);
     error.AppendFormat("Invalid projection '{0} => {1}'. '{0}' is already mapped to '{2}'.",
         item.From, item.To, existingValue);
     return error.ToString();
 }
예제 #9
0
        public static string EnumValueDoesntExistError(MemberMappingDescriptor member, ProjectionItem item)
        {
            StringBuilder error = GetIntro(member);

            error.AppendFormat("Invalid projection '{0} => {1}'. Value '{1}' is not defined in '{2}' enumeration",
                               item.From, item.To, member.Type.FullName);
            return(error.ToString());
        }
예제 #10
0
        public static string DuplicateProjectionError(MemberMappingDescriptor member, ProjectionItem item, string existingValue)
        {
            StringBuilder error = GetIntro(member);

            error.AppendFormat("Invalid projection '{0} => {1}'. '{0}' is already mapped to '{2}'.",
                               item.From, item.To, existingValue);
            return(error.ToString());
        }
예제 #11
0
        public static string CantAggregateOverNoncollectionError(MemberMappingDescriptor member, string aggregateFunction)
        {
            StringBuilder error = GetIntro(member);

            error.AppendFormat("Target member '{0}' for '{1}' aggregate function must be an array or a collection.",
                               member.Member, aggregateFunction);
            return(error.ToString());
        }
예제 #12
0
 public MemberMappingDescriptor(MemberMappingDescriptor copyFrom)
 {
     m_member        = copyFrom.m_member;
     m_expression    = copyFrom.m_expression;
     m_format        = copyFrom.m_format;
     m_nullValue     = copyFrom.m_nullValue;
     m_type          = copyFrom.m_type;
     m_ownerType     = copyFrom.m_ownerType;
     m_isArray       = copyFrom.m_isArray;
     m_isList        = copyFrom.m_isList;
     m_projections   = copyFrom.m_projections;
     m_nullableParts = copyFrom.m_nullableParts;
 }
 public MemberMappingDescriptor(MemberMappingDescriptor copyFrom)
 {
     m_member = copyFrom.m_member;
     m_expression = copyFrom.m_expression;
     m_format = copyFrom.m_format;
     m_nullValue = copyFrom.m_nullValue;
     m_type = copyFrom.m_type;
     m_ownerType = copyFrom.m_ownerType;
     m_isArray = copyFrom.m_isArray;
     m_isList = copyFrom.m_isList;
     m_projections = copyFrom.m_projections;
     m_nullableParts = copyFrom.m_nullableParts;
 }
예제 #14
0
        private static StringBuilder GetIntro(MemberMappingDescriptor member)
        {
            StringBuilder sb = new StringBuilder(100);
            if (member == null)
            {
                sb.Append("Error while generating mapping:");
            }
            else
            {
                sb.AppendFormat("Error while generating mapping for member '{0}' of class '{1}':",
                                member.Member, member.OwnerType.FullName);
            }

            sb.AppendLine("");
            return sb;
        }
예제 #15
0
        private static StringBuilder GetIntro(MemberMappingDescriptor member)
        {
            StringBuilder sb = new StringBuilder(100);

            if (member == null)
            {
                sb.Append("Error while generating mapping:");
            }
            else
            {
                sb.AppendFormat("Error while generating mapping for member '{0}' of class '{1}':",
                                member.Member, member.OwnerType.FullName);
            }

            sb.AppendLine("");
            return(sb);
        }
예제 #16
0
 public static string InvalidProjectionStringError(MemberMappingDescriptor member, string projection)
 {
     StringBuilder error = GetIntro(member);
     error.AppendFormat("Invalid projection. Expression '' is not a valid projection string");
     return error.ToString();
 }
예제 #17
0
 public static string InvalidAggregatePathError(MemberMappingDescriptor member)
 {
     StringBuilder error = GetIntro(member);
     error.AppendFormat("Invalid path for aggregate expression: '{0}'", member.Expression);
     return error.ToString();
 }
예제 #18
0
 public static string EmptyToAttributeInXmlError(MemberMappingDescriptor member, string xml)
 {
     StringBuilder error = GetIntro(member);
     error.AppendFormat("Invalid projection. Attribute 'to' in XML projection mapping must not be empty");
     return error.ToString();
 }
예제 #19
0
 public static string CantAggregateOverUntypedCollections(MemberMappingDescriptor member)
 {
     StringBuilder error = GetIntro(member);
     error.AppendFormat("Aggregate functions can only be used over arrays of generic collections. Nongeneric collections are not supported.");
     return error.ToString();
 }
예제 #20
0
 public static string CreateStandardErrorMessage(MemberMappingDescriptor member, string message)
 {
     StringBuilder error = GetIntro(member);
     error.Append(message);
     return error.ToString();
 }