Skip to content
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
Cannot retrieve contributors at this time
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Web.Api.Core.Dto.UseCaseRequests;
using Web.Api.Core.Interfaces.UseCases;
using Web.Api.Presenters;
namespace Web.Api.Controllers
public class AccountsController : ControllerBase
private readonly IRegisterUserUseCase _registerUserUseCase;
private readonly RegisterUserPresenter _registerUserPresenter;
public AccountsController(IRegisterUserUseCase registerUserUseCase, RegisterUserPresenter registerUserPresenter)
_registerUserUseCase = registerUserUseCase;
_registerUserPresenter = registerUserPresenter;
// POST api/accounts
public async Task<ActionResult> Post([FromBody] Models.Request.RegisterUserRequest request)
if (!ModelState.IsValid)
{ // re-render the view when validation failed.
return BadRequest(ModelState);
await _registerUserUseCase.Handle(new RegisterUserRequest(request.FirstName,request.LastName,request.Email, request.UserName,request.Password), _registerUserPresenter);
return _registerUserPresenter.ContentResult;