Ejemplo n.º 1
0
 // POST /api/shames
 public void Post(ShameViewModel shame)
 {
     using (ShameRepository repo = new ShameRepository(User.Identity.GetUserId()))
         repo.Add(new Shame
         {
             ID        = shame.ID,
             Name      = shame.Name,
             ImagePath = shame.ImagePath
         });
 }
Ejemplo n.º 2
0
 // GET /api/shames
 public List <ShameViewModel> Get()
 {
     using (ShameRepository repo = new ShameRepository(User.Identity.GetUserId()))
         return(repo.Get().Select(s => new ShameViewModel
         {
             ID = s.ID,
             Name = s.Name,
             ImagePath = s.ImagePath
         }).ToList());
 }