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.

32 lines
924 B

using AspNetCoreApi.Models;
using AspNetCoreApi.Services;
using Microsoft.AspNetCore.Mvc;
namespace AspNetCoreApi.Controllers
{
[ApiController]
[Route("[controller]")]
public class ApplicationUserController : ControllerBase
{
private readonly ILogger<ProductController> _logger;
private readonly ApplicationUserService _service;
public ApplicationUserController(ILogger<ProductController> logger, ApplicationUserService service)
{
_logger = logger;
_service = service;
}
[HttpPost(Name = "PostApplicationUser")]
public async Task<bool> Post(string name, string email, string password)
{
ApplicationUser user = new ApplicationUser
{
UserName = name,
Email = email,
};
return await _service.Register(user, password);
}
}
}