Create a class like JsonObjectContainer
public class JsonObjectContainer
{
public JsonObjectContainer()
{
AuthenticateResponse=new AuthenticateResponse();
}
public AuthenticateResponse AuthenticateResponse { get; set; }
}
Use it instead of AuthenticateResponse
JsonObjectContainer ar = new JsonObjectContainer();
ar.AuthenticateResponse.StatusMessage = "Test status Message";
ar.AuthenticateResponse.IlsMessage = "Test IlsMessage";
ar.AuthenticateResponse.IlsCode = "Code 614";
string json = JsonConvert.SerializeObject(ar);