I am using ASP.NET Web API 2 with attribute routing.
I have the following PlayerModel
.
public class PlayerModel
{
public int Id { get; set; }
public string Key { get; set; }
public string Name { get; set; }
public string Password { get; set; }
public int TeamId { get; set; }
public PlayerStatModel Stat{ get; set; }
}
public class PlayerStatModel
{
public int PlayerId { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string Title { get; set; }
public string EmailAddress { get; set; }
public IEnumerable<PhoneNumberModel> PhoneNumbers { get; set; }
public int TeamId { get; set; }
}
public class PhoneNumberModel
{
public string Value { get; set; }
public string Extension { get; set; }
}
Which in turn is passed into PostPlayer
for player creation.
[HttpPost("", RouteName = "PostPlayer")]
public PlayerModel PostPlayer(PlayerModel player)
{
var playerObject = this.GetObject(player));
this._manager.CreatePlayer(playerObject );
return this.GetPlayer(playerObject.Id);
}
My integration tests pass and I am able to verify that player is indeed created when CreatePlayer
is invoked.
How can I model this POST
request in the POSTMAN Rest Client in Google Chrome?