I am in a situation where i need to return the single object along with string .. I am very new to web api and just could not be able to figure it out how to return multiple parameters ..
below is the code what i have tried so far ..
public async Task<IHttpActionResult> PostAuthenticationData(long id, string password)
{
Consumer consumer = await db.Consumers.FindAsync(id);
if (consumer == null)
{
return NotFound();
}
if(consumer.ConsumerPassword != password)
{
return BadRequest();
}
ConsumerSessionTokenLog consumerSessionTokenLog = await db.ConsumerSessionTokenLogs.FindAsync(id);
if(consumerSessionTokenLog == null)
{
return NotFound();
}
else
{
string sessionToken = consumerSessionTokenLog.SessionToken;
}
/// here i need to return "sessionToken" and "consumer" object
return Ok(consumer);
}
Could any one please help on this query..
Many thanks in advance