InventoryType from XML

Transaction updates
This commit is contained in:
2016-08-25 13:00:09 -04:00
parent 53ed1b3af9
commit a5fcb46e04
28 changed files with 471 additions and 70 deletions
@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using AutoMapper;
using AutoMapper.QueryableExtensions;
using InventoryTraker.Web.ActionResults;
using InventoryTraker.Web.Core;
using InventoryTraker.Web.Data;
using InventoryTraker.Web.Models;
namespace InventoryTraker.Web.Controllers
{
public class TransactionController : ControllerBase
{
private readonly AppDbContext _context;
public TransactionController(AppDbContext context)
{
_context = context;
}
public ActionResult Index()
{
return View();
}
public JsonResult All()
{
var viewModels =
_context.Transactions
.ProjectTo<TransactionViewModel>()
.ToArray();
return BetterJson(viewModels);
}
}
}