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.

25 lines
643 B

using AspNetCoreApi.DbContexts;
using AspNetCoreApi.Models;
using Microsoft.AspNetCore.Identity;
namespace AspNetCoreApi.Services
{
public class ApplicationUserService
{
private readonly UserManager<ApplicationUser> _manager;
public ApplicationUserService(UserManager<ApplicationUser> manager)
{
_manager = manager;
}
public async Task<bool> Register(ApplicationUser user, string password)
{
var result = await _manager.CreateAsync(user, password);
if (result.Succeeded)
return true;
return false;
}
}
}