Skip to content

Commit 7736631

Browse files
committed
demo
1 parent ee6162a commit 7736631

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

Demo/HttpClients/UserInfo.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
using System;
2+
using System.Text;
3+
using System.Linq;
24
using WebApiClient.DataAnnotations;
35

46
namespace Demo.HttpClients
@@ -17,16 +19,10 @@ public class UserInfo
1719
[DateTimeFormat("yyyy-MM-dd")]
1820
public DateTime? BirthDay { get; set; }
1921

20-
[IgnoreWhenNull]
21-
public Gender? Gender { get; set; }
22+
public Gender Gender { get; set; }
2223

2324
[IgnoreSerialized]
2425
public string Email { get; set; }
25-
26-
public override string ToString()
27-
{
28-
return string.Format("{{Account:{0}, Password:{1}, BirthDay:{2}}}", this.Account, this.Password, this.BirthDay);
29-
}
3026
}
3127

3228
/// <summary>
@@ -35,7 +31,6 @@ public override string ToString()
3531
public enum Gender
3632
{
3733
Female = 0,
38-
3934
Male = 1
4035
}
4136
}

Demo/Program.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ private static async Task RunApisAsync(IUserApi userApiClient)
3838
Account = "laojiu",
3939
Password = "123456",
4040
BirthDay = DateTime.Parse("2018-01-01 12:30:30"),
41-
Email = "laojiu@webapiclient.com"
41+
Email = "laojiu@webapiclient.com",
42+
Gender = Gender.Male
4243
};
4344

4445
var aboutResult = await userApiClient.GetAboutAsync(

0 commit comments

Comments
 (0)