Skip to content

Commit 617c382

Browse files
committed
Add IRequiredMemberSelector support in NetCore assembly
1 parent 457b571 commit 617c382

File tree

2 files changed

+0
-6
lines changed

2 files changed

+0
-6
lines changed

src/System.Net.Http.Formatting/Formatting/MediaTypeFormatter.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ internal List<MediaTypeMapping> MediaTypeMappingsInternal
129129
get { return _mediaTypeMappings; }
130130
}
131131

132-
#if !NETFX_CORE // IRequiredMemberSelector is not in portable libraries because there is no model state on the client.
133132
/// <summary>
134133
/// Gets or sets the <see cref="IRequiredMemberSelector"/> used to determine required members.
135134
/// </summary>
@@ -144,7 +143,6 @@ public virtual IRequiredMemberSelector RequiredMemberSelector
144143
_requiredMemberSelector = value;
145144
}
146145
}
147-
#endif
148146

149147
internal virtual bool CanWriteAnyTypes
150148
{

test/System.Net.Http.Formatting.Test/Formatting/JsonNetValidationTest.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ public static TheoryDataSet<string, Type, int> Theories
4343
}
4444
}
4545

46-
#if !NETFX_CORE // IRequiredMemeberSelector is not in portable libraries because there is no model state on the client.
4746
[Theory]
4847
[PropertyData("Theories")]
4948
public async Task ModelErrorsPopulatedWithValidationErrors(string json, Type type, int expectedErrors)
@@ -56,7 +55,6 @@ public async Task ModelErrorsPopulatedWithValidationErrors(string json, Type typ
5655

5756
mockLogger.Verify(mock => mock.LogError(It.IsAny<string>(), It.IsAny<Exception>()), Times.Exactly(expectedErrors));
5857
}
59-
#endif
6058

6159
[Fact]
6260
public async Task HittingMaxDepthRaisesOnlyOneValidationError()
@@ -81,7 +79,6 @@ public async Task HittingMaxDepthRaisesOnlyOneValidationError()
8179
}
8280
}
8381

84-
#if !NETFX_CORE // IRequiredMemeberSelector is not in portable libraries because there is no model state on the client.
8582
// this IRMS treats all member names that start with "Required" as required
8683
public class SimpleRequiredMemberSelector : IRequiredMemberSelector
8784
{
@@ -90,7 +87,6 @@ public bool IsRequiredMember(MemberInfo member)
9087
return member.Name.StartsWith("Required");
9188
}
9289
}
93-
#endif
9490

9591
public class DataContractWithRequiredMembers
9692
{

0 commit comments

Comments
 (0)