Backend for the Teso project written in 2022
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.

42 lines
1020 B

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Teso_API.Models;
namespace Teso_API.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class EmailController : ControllerBase
{
private readonly TESOContext _context;
public EmailController(TESOContext context)
{
_context = context;
}
// GET: api/Email/5
[HttpGet("{id}")]
public async Task<ActionResult> GetTesoUserDetail(string id)
{
if (!TesoUserDetailExists(id))
{
return Ok("Available");
}
else
{
return Conflict("Not Available");
}
}
private bool TesoUserDetailExists(string id)
{
return _context.TesoUserDetails.Any(e => e.Email == id);
}
}
}