|
|
|
@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using cat_cafe.Entities;
|
|
|
|
|
using cat_cafe.Repositories;
|
|
|
|
|
using cat_cafe.Dto;
|
|
|
|
|
|
|
|
|
|
namespace cat_cafe.Controllers
|
|
|
|
|
{
|
|
|
|
@ -23,7 +24,7 @@ namespace cat_cafe.Controllers
|
|
|
|
|
|
|
|
|
|
// GET: api/Customers
|
|
|
|
|
[HttpGet]
|
|
|
|
|
public async Task<ActionResult<IEnumerable<Customer>>> GetCustomers()
|
|
|
|
|
public async Task<ActionResult<IEnumerable<CustomerDto>>> GetCustomers()
|
|
|
|
|
{
|
|
|
|
|
if (_context.Customers == null)
|
|
|
|
|
{
|
|
|
|
@ -34,7 +35,7 @@ namespace cat_cafe.Controllers
|
|
|
|
|
|
|
|
|
|
// GET: api/Customers/5
|
|
|
|
|
[HttpGet("{id}")]
|
|
|
|
|
public async Task<ActionResult<Customer>> GetCustomer(long id)
|
|
|
|
|
public async Task<ActionResult<CustomerD>> GetCustomer(long id)
|
|
|
|
|
{
|
|
|
|
|
if (_context.Customers == null)
|
|
|
|
|
{
|
|
|
|
|