Skip to content

Instantly share code, notes, and snippets.

@mikebrind
Created July 12, 2018 12:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikebrind/f330718d98f90b3fa28d0f27ddee55e6 to your computer and use it in GitHub Desktop.
Save mikebrind/f330718d98f90b3fa28d0f27ddee55e6 to your computer and use it in GitHub Desktop.
using KnockoutTS.Models;
using KnockoutTS.Services;
using Microsoft.AspNetCore.Mvc;
namespace KnockoutTS.Controllers
{
[Route("api/[controller]")]
public class MailController : Controller
{
private readonly IMailService _mailService;
public MailController(IMailService mailService)
{
_mailService = mailService;
}
[HttpGet, Route("getfolder")]
public Folder Get(string folder)
{
return _mailService.GetMailByFolder(folder);
}
[HttpGet("{mailId:int}"), Route("getmail")]
public Mail Get(int mailId)
{
return _mailService.GetMail(mailId);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment