|
4 | 4 | using System.Collections; |
5 | 5 | using System.Collections.Generic; |
6 | 6 | using System.ComponentModel; |
7 | | -using System.ComponentModel.DataAnnotations; |
8 | | -using System.ComponentModel.DataAnnotations.Schema; |
9 | 7 | using System.Diagnostics; |
10 | 8 | using System.Globalization; |
11 | 9 | using System.Linq; |
@@ -861,7 +859,7 @@ public void AddMembersTo(CodeTypeDeclaration typeDeclaration, bool withDataBindi |
861 | 859 | } |
862 | 860 |
|
863 | 861 | var ignoreAttribute = new CodeAttributeDeclaration(CodeUtilities.CreateTypeReference(typeof(XmlIgnoreAttribute), Configuration)); |
864 | | - var notMappedAttribute = new CodeAttributeDeclaration(CodeUtilities.CreateTypeReference(typeof(NotMappedAttribute), Configuration)); |
| 862 | + var notMappedAttribute = new CodeAttributeDeclaration(CodeUtilities.CreateTypeReference("System.ComponentModel.DataAnnotations.Schema", "NotMappedAttribute", Configuration)); |
865 | 863 | backingField.CustomAttributes.Add(ignoreAttribute); |
866 | 864 |
|
867 | 865 | if (requiresBackingField) |
@@ -949,7 +947,7 @@ public void AddMembersTo(CodeTypeDeclaration typeDeclaration, bool withDataBindi |
949 | 947 |
|
950 | 948 | if (!IsNullable && Configuration.DataAnnotationMode != DataAnnotationMode.None) |
951 | 949 | { |
952 | | - var requiredAttribute = new CodeAttributeDeclaration(CodeUtilities.CreateTypeReference(typeof(RequiredAttribute), Configuration)); |
| 950 | + var requiredAttribute = new CodeAttributeDeclaration(CodeUtilities.CreateTypeReference("System.ComponentModel.DataAnnotations", "RequiredAttribute", Configuration)); |
953 | 951 | member.CustomAttributes.Add(requiredAttribute); |
954 | 952 | } |
955 | 953 |
|
@@ -1151,7 +1149,7 @@ public void AddMembersTo(CodeTypeDeclaration typeDeclaration, bool withDataBindi |
1151 | 1149 |
|
1152 | 1150 | if (IsKey) |
1153 | 1151 | { |
1154 | | - var keyAttribute = new CodeAttributeDeclaration(CodeUtilities.CreateTypeReference(typeof(KeyAttribute), Configuration)); |
| 1152 | + var keyAttribute = new CodeAttributeDeclaration(CodeUtilities.CreateTypeReference("System.ComponentModel.DataAnnotations", "KeyAttribute", Configuration)); |
1155 | 1153 | member.CustomAttributes.Add(keyAttribute); |
1156 | 1154 | } |
1157 | 1155 |
|
@@ -1529,7 +1527,7 @@ public IEnumerable<CodeAttributeDeclaration> GetRestrictionAttributes() |
1529 | 1527 | if (minInclusive != null && maxInclusive != null) |
1530 | 1528 | { |
1531 | 1529 | var rangeAttribute = new CodeAttributeDeclaration( |
1532 | | - CodeUtilities.CreateTypeReference(typeof(RangeAttribute), Configuration), |
| 1530 | + CodeUtilities.CreateTypeReference("System.ComponentModel.DataAnnotations", "RangeAttribute", Configuration), |
1533 | 1531 | new CodeAttributeArgument(new CodeTypeOfExpression(minInclusive.Type)), |
1534 | 1532 | new CodeAttributeArgument(new CodePrimitiveExpression(minInclusive.Value)), |
1535 | 1533 | new CodeAttributeArgument(new CodePrimitiveExpression(maxInclusive.Value))); |
|
0 commit comments