You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
598 B
27 lines
598 B
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using WebAPIWithEF.Data;
|
|
using WebAPIWithEF.Models;
|
|
|
|
namespace WebAPIWithEF.Controllers
|
|
{
|
|
[ApiController]
|
|
[Route("[controller]")]
|
|
public class CouponController : ControllerBase
|
|
{
|
|
PromotionsContext _context;
|
|
|
|
public CouponController(PromotionsContext context)
|
|
{
|
|
_context = context;
|
|
}
|
|
|
|
[HttpGet]
|
|
public IEnumerable<Coupon> Get()
|
|
{
|
|
return _context.Coupons
|
|
.AsNoTracking()
|
|
.ToList();
|
|
}
|
|
}
|
|
}
|
|
|