Skip to content

Commit

Permalink
Nullable Examples.Wcf.Shared
Browse files Browse the repository at this point in the history
  • Loading branch information
Kielek committed Sep 18, 2023
1 parent a6f41d5 commit 951cc9f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
6 changes: 1 addition & 5 deletions examples/wcf/client-core/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,7 @@ private static async Task CallService(Binding binding, EndpointAddress remoteAdd
{
await client.OpenAsync().ConfigureAwait(false);

var response = await client.PingAsync(
new StatusRequest
{
Status = Guid.NewGuid().ToString("N"),
}).ConfigureAwait(false);
var response = await client.PingAsync(new StatusRequest(Guid.NewGuid().ToString("N"))).ConfigureAwait(false);

Console.WriteLine($"Server returned: {response?.ServerTime}");
}
Expand Down
6 changes: 1 addition & 5 deletions examples/wcf/client-netframework/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,7 @@ private static async Task CallService(string name)
{
await client.OpenAsync().ConfigureAwait(false);

var response = await client.PingAsync(
new StatusRequest
{
Status = Guid.NewGuid().ToString("N"),
}).ConfigureAwait(false);
var response = await client.PingAsync(new StatusRequest(Guid.NewGuid().ToString("N"))).ConfigureAwait(false);

Console.WriteLine($"Server returned: {response?.ServerTime}");
}
Expand Down
1 change: 0 additions & 1 deletion examples/wcf/shared/Examples.Wcf.Shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<PropertyGroup>
<!-- OmniSharp/VS Code requires TargetFrameworks to be in descending order for IntelliSense and analysis. -->
<TargetFrameworks>netstandard2.0;net462</TargetFrameworks>
<Nullable>disable</Nullable>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
Expand Down
5 changes: 5 additions & 0 deletions examples/wcf/shared/StatusRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ namespace Examples.Wcf;
[DataContract]
public class StatusRequest
{
public StatusRequest(string status)
{
this.Status = status;
}

[DataMember]
public string Status { get; set; }
}

0 comments on commit 951cc9f

Please sign in to comment.