Add global usings
This commit is contained in:
parent
2e737359c7
commit
43a9187579
@ -1,8 +1,6 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Todo.Core.Entities;
|
||||
using Todo.Core.Interfaces.Persistence;
|
||||
|
||||
namespace Todo.Api.Controllers
|
||||
@ -20,12 +18,6 @@ namespace Todo.Api.Controllers
|
||||
_userRepository = userRepository;
|
||||
}
|
||||
|
||||
public record RegisterUserRequest
|
||||
{
|
||||
[Required] public string Email { get; init; }
|
||||
[Required] public string Password { get; init; }
|
||||
}
|
||||
|
||||
[HttpPost("register")]
|
||||
public async Task<IActionResult> Register([FromBody] RegisterUserRequest request)
|
||||
{
|
||||
@ -33,5 +25,11 @@ namespace Todo.Api.Controllers
|
||||
|
||||
return Ok(user);
|
||||
}
|
||||
|
||||
public record RegisterUserRequest
|
||||
{
|
||||
[Required] public string Email { get; init; }
|
||||
[Required] public string Password { get; init; }
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Todo.Core.Interfaces.Persistence;
|
||||
|
||||
@ -17,11 +15,6 @@ public class TodosController : ControllerBase
|
||||
_todoRepository = todoRepository;
|
||||
}
|
||||
|
||||
public record CreateTodoRequest
|
||||
{
|
||||
[Required] public string Title { get; init; }
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<ActionResult<Core.Entities.Todo>> CreateTodo([FromBody] CreateTodoRequest request)
|
||||
{
|
||||
@ -37,4 +30,9 @@ public class TodosController : ControllerBase
|
||||
|
||||
return Ok(todos);
|
||||
}
|
||||
|
||||
public record CreateTodoRequest
|
||||
{
|
||||
[Required] public string Title { get; init; }
|
||||
}
|
||||
}
|
@ -1,6 +1,4 @@
|
||||
using System;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using Todo.Core.Interfaces.Persistence;
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
namespace Todo.Core.Interfaces.Persistence;
|
||||
|
||||
public interface ITodoRepository
|
||||
|
@ -1,5 +1,7 @@
|
||||
global using System;
|
||||
global using System.Threading.Tasks;
|
||||
global using System.Linq;
|
||||
global using System.Collections.Generic;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Todo.Core.Interfaces.Persistence;
|
||||
using Todo.Persistence.Mongo.Repositories;
|
||||
|
@ -1,5 +1,3 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using MongoDB.Driver;
|
||||
using Todo.Persistence.Mongo.Repositories.Dtos;
|
||||
|
@ -1,6 +1,3 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using MongoDB.Driver;
|
||||
using Todo.Core.Interfaces.Persistence;
|
||||
using Todo.Persistence.Mongo.Repositories.Dtos;
|
||||
|
@ -1,4 +1,3 @@
|
||||
using System.Threading.Tasks;
|
||||
using MongoDB.Driver;
|
||||
using Todo.Core.Entities;
|
||||
using Todo.Core.Interfaces.Persistence;
|
||||
|
Loading…
Reference in New Issue
Block a user