La aplicación se completó sin leer todo el cuerpo de la solicitud, .net core 2.1.1

He creado un controlador de registro de usuarios para registrar usuarios con un patrón de diseño de repositorio. Mi controlador se ve así.

[Route("api/[controller]")]
    public class AuthController : Controller
    {
        private readonly IAuthRepository _repo;
        public AuthController(IAuthRepository repo)
        {
            _repo = repo;
        }

        [AllowAnonymous]
        [HttpPost("register")]
        public async Task<IActionResult> Register([FromBody] UserForRegisterDto userForRegisterDto){
            // validate request
            if(!ModelState.IsValid)
            return BadRequest(ModelState);

            userForRegisterDto.Username = userForRegisterDto.Username.ToLower();

            if(await _repo.UserExists(userForRegisterDto.Username)) 
            return BadRequest("Username is already taken");

            var userToCreate = new User{
                Username = userForRegisterDto.Username
            };

            var createUser = await _repo.Register(userToCreate, userForRegisterDto.Password);

            return StatusCode(201);
        }
    }

Cuando envío una solicitud usando Postman, me da el código de estado 404 no encontrado, y API informa que la solicitud se completó sin leer todo el cuerpo.

Mi solicitud en Cartero se ve así. @

He usado Data Transfer Objects (DTO) para encapsular datos, eliminéUserForRegisterDto e intentó usarstring username ystring password, como sigue pero no funcionó.

public async Task<IActionResult> Register([FromBody] string username, string password)

UserForRegisterDto Se ve como esto

 public class UserForRegisterDto
    {
        [Required]
        public string Username { get; set; }

        [Required]
        [StringLength(8, MinimumLength =4, ErrorMessage = "You must specify a password between 4 and 8 characters.")]
        public string Password { get; set; }
    }

He intentado muchas soluciones en línea para esto, pero hasta ahora nada resolvió mi problema. Ayúdenme a solucionar el problema. Gracias de antemano. Estoy ejecutando esta API en Ubuntu 18.04

Editar Startup.cs

public class Startup
    {
        public Startup(IConfiguration configuration)
        {
            Configuration = configuration;
        }

        public IConfiguration Configuration { get; }

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddDbContext<DataContext>(x => x.UseSqlite(Configuration.GetConnectionString("DefaultConnection")));
            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);

            services.AddCors();
            services.AddScoped<IAuthRepository, AuthRepository>();
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseHsts();
            }
            app.UseCors(x => x.AllowAnyHeader().AllowAnyMethod().AllowAnyOrigin().AllowCredentials());
            app.UseMvc();
        }
    }

Respuestas a la pregunta(6)

Su respuesta a la pregunta