Skip to content

Commit

Permalink
More REST-ful
Browse files Browse the repository at this point in the history
  • Loading branch information
DamianEdwards committed Jun 7, 2016
1 parent 1d4fbbf commit 89f1011
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions App/AttendeeList/Controllers/AttendeesController.cs
Expand Up @@ -46,16 +46,21 @@ public async Task<IActionResult> Details(int? id)

[HttpGet("{id:int}/vcard")]
[Produces("text/vcard")]
public async Task<Attendee> VCard(int? id)
public async Task<IActionResult> VCard(int? id)
{
if (id == null)
{
return null;
return NotFound();
}

var attendee = await _context.Attendees.SingleOrDefaultAsync(m => m.Id == id);

if (attendee == null)
{
return NotFound();
}

return attendee;
return Ok(attendee);
}

// GET: Attendees/Create
Expand Down

0 comments on commit 89f1011

Please sign in to comment.