diff --git a/exercise.wwwapi/DTOs/GetObjects/PostsSuccessDTO.cs b/exercise.wwwapi/DTOs/GetObjects/PostsSuccessDTO.cs index 458586c..2a3f245 100644 --- a/exercise.wwwapi/DTOs/GetObjects/PostsSuccessDTO.cs +++ b/exercise.wwwapi/DTOs/GetObjects/PostsSuccessDTO.cs @@ -1,5 +1,4 @@ using exercise.wwwapi.Models; -using exercise.wwwapi.Models.UserInfo; using System.Text.Json.Serialization; namespace exercise.wwwapi.DTOs.GetObjects diff --git a/exercise.wwwapi/DTOs/GetObjects/UsersSuccessDTO.cs b/exercise.wwwapi/DTOs/GetObjects/UsersSuccessDTO.cs index 25a4a5e..6719cbf 100644 --- a/exercise.wwwapi/DTOs/GetObjects/UsersSuccessDTO.cs +++ b/exercise.wwwapi/DTOs/GetObjects/UsersSuccessDTO.cs @@ -1,5 +1,4 @@ using System.Text.Json.Serialization; -using exercise.wwwapi.Models.UserInfo; namespace exercise.wwwapi.DTOs.GetUsers; diff --git a/exercise.wwwapi/DTOs/Notes/NoteDTO.cs b/exercise.wwwapi/DTOs/Notes/NoteDTO.cs index bc6f4f8..9a10a9b 100644 --- a/exercise.wwwapi/DTOs/Notes/NoteDTO.cs +++ b/exercise.wwwapi/DTOs/Notes/NoteDTO.cs @@ -1,5 +1,4 @@ -using exercise.wwwapi.Models.UserInfo; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Text.Json.Serialization; diff --git a/exercise.wwwapi/DTOs/Posts/GetPosts/AuthorDTO.cs b/exercise.wwwapi/DTOs/Posts/GetPosts/AuthorDTO.cs index 6d33dad..b8fc623 100644 --- a/exercise.wwwapi/DTOs/Posts/GetPosts/AuthorDTO.cs +++ b/exercise.wwwapi/DTOs/Posts/GetPosts/AuthorDTO.cs @@ -1,5 +1,4 @@ using exercise.wwwapi.Models; -using exercise.wwwapi.Models.UserInfo; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Text.Json.Serialization; @@ -9,8 +8,6 @@ namespace exercise.wwwapi.DTOs.Posts.GetPosts public class AuthorDTO { public int Id { get; set; } - - //public ProfileDTO Profile { get; set; } public string firstName { get; set; } public string lastName { get; set; } @@ -21,9 +18,8 @@ public AuthorDTO() public AuthorDTO(User model) { Id = model.Id; - //Profile = new ProfileDTO(model.Profile); - firstName = model.Profile.FirstName; - lastName = model.Profile.LastName; + firstName = model.FirstName; + lastName = model.LastName; } } } diff --git a/exercise.wwwapi/DTOs/Posts/GetPosts/CommentDTO.cs b/exercise.wwwapi/DTOs/Posts/GetPosts/CommentDTO.cs index 91911c1..c8a1821 100644 --- a/exercise.wwwapi/DTOs/Posts/GetPosts/CommentDTO.cs +++ b/exercise.wwwapi/DTOs/Posts/GetPosts/CommentDTO.cs @@ -19,8 +19,8 @@ public CommentDTO(Comment model) UserId = model.UserId; Body = model.Body; CreatedAt = model.CreatedAt; - firstName = model.User.Profile.FirstName; - lastName = model.User.Profile.LastName; + firstName = model.User.FirstName; + lastName = model.User.LastName; } } } diff --git a/exercise.wwwapi/DTOs/Posts/GetPosts/PostDTOVol2.cs b/exercise.wwwapi/DTOs/Posts/GetPosts/PostDTOVol2.cs index 4fd0b1f..64d6918 100644 --- a/exercise.wwwapi/DTOs/Posts/GetPosts/PostDTOVol2.cs +++ b/exercise.wwwapi/DTOs/Posts/GetPosts/PostDTOVol2.cs @@ -24,8 +24,8 @@ public PostDTOVol2(Post model) AuthorId = model.AuthorId; Body = model.Body; CreatedAt = model.CreatedAt; - Firstname = model.Author.Profile.FirstName; - Lastname = model.Author.Profile.LastName; + Firstname = model.Author.FirstName; + Lastname = model.Author.LastName; Comments = model.Comments.Select(c => new CommentDTO(c)).ToList(); Likes = model.Likes.Select(l => new LikeDTO(l)).ToList(); } diff --git a/exercise.wwwapi/DTOs/Posts/GetPosts/ProfileDTO.cs b/exercise.wwwapi/DTOs/Posts/GetPosts/ProfileDTO.cs deleted file mode 100644 index 455a253..0000000 --- a/exercise.wwwapi/DTOs/Posts/GetPosts/ProfileDTO.cs +++ /dev/null @@ -1,20 +0,0 @@ -using exercise.wwwapi.Models.UserInfo; - -namespace exercise.wwwapi.DTOs.Posts.GetPosts -{ - public class ProfileDTO - { - public string firstName { get; set; } - public string lastName { get; set; } - - public ProfileDTO() - { - - } - public ProfileDTO(Profile model) - { - firstName = model.FirstName; - lastName = model.LastName; - } - } -} diff --git a/exercise.wwwapi/DTOs/Register/RegisterRequestDTO.cs b/exercise.wwwapi/DTOs/Register/RegisterRequestDTO.cs index fee0547..8aacaff 100644 --- a/exercise.wwwapi/DTOs/Register/RegisterRequestDTO.cs +++ b/exercise.wwwapi/DTOs/Register/RegisterRequestDTO.cs @@ -21,7 +21,10 @@ public class RegisterRequestDTO [JsonPropertyName("lastName")] public string? LastName { get; set; } - + + [JsonPropertyName("mobile")] + public string? Mobile { get; set; } + [JsonPropertyName("bio")] public string? Bio { get; set; } diff --git a/exercise.wwwapi/DTOs/UpdateUser/UpdateUserRequestDTO.cs b/exercise.wwwapi/DTOs/UpdateUser/UpdateUserRequestDTO.cs index 1952d93..ddab366 100644 --- a/exercise.wwwapi/DTOs/UpdateUser/UpdateUserRequestDTO.cs +++ b/exercise.wwwapi/DTOs/UpdateUser/UpdateUserRequestDTO.cs @@ -26,8 +26,8 @@ public class UpdateUserRequestDTO [JsonPropertyName("username")] public string? Username { get; set; } - [JsonPropertyName("phone")] - public string? Phone { get; set; } + [JsonPropertyName("mobile")] + public string? Mobile { get; set; } [JsonPropertyName("cohortId")] public int? CohortId { get; set; } diff --git a/exercise.wwwapi/DTOs/UpdateUser/UpdateUserSuccessDTO.cs b/exercise.wwwapi/DTOs/UpdateUser/UpdateUserSuccessDTO.cs index f2bb06f..f224b78 100644 --- a/exercise.wwwapi/DTOs/UpdateUser/UpdateUserSuccessDTO.cs +++ b/exercise.wwwapi/DTOs/UpdateUser/UpdateUserSuccessDTO.cs @@ -26,8 +26,8 @@ public class UpdateUserSuccessDTO [JsonPropertyName("github")] public string? Github { get; set; } - [JsonPropertyName("phone")] - public string? Phone { get; set; } + [JsonPropertyName("Mobile")] + public string? Mobile { get; set; } [JsonPropertyName("cohortId")] public int? CohortId { get; set; } diff --git a/exercise.wwwapi/DTOs/UserDTO.cs b/exercise.wwwapi/DTOs/UserDTO.cs index 480f655..e0d483f 100644 --- a/exercise.wwwapi/DTOs/UserDTO.cs +++ b/exercise.wwwapi/DTOs/UserDTO.cs @@ -29,21 +29,12 @@ public class UserDTO [JsonPropertyName("username")] public string? Username { get; set; } - [JsonPropertyName("phone")] - public string? Phone { get; set; } - - [JsonPropertyName("startDate")] - public DateTime? StartDate { get; set; } - - [JsonPropertyName("endDate")] - public DateTime? EndDate { get; set; } + [JsonPropertyName("mobile")] + public string? Mobile { get; set; } [JsonPropertyName("specialism")] public Specialism? Specialism { get; set; } - [JsonPropertyName("cohortId")] - public int? CohortId { get; set; } - [JsonPropertyName("notes")] public ICollection Notes { get; set; } [JsonPropertyName("role")] diff --git a/exercise.wwwapi/Data/ModelSeeder.cs b/exercise.wwwapi/Data/ModelSeeder.cs index a3cb86a..b261d4e 100644 --- a/exercise.wwwapi/Data/ModelSeeder.cs +++ b/exercise.wwwapi/Data/ModelSeeder.cs @@ -1,6 +1,5 @@ using exercise.wwwapi.Enums; using exercise.wwwapi.Models; -using exercise.wwwapi.Models.UserInfo; using Microsoft.AspNetCore.Http.HttpResults; using Microsoft.EntityFrameworkCore; diff --git a/exercise.wwwapi/Endpoints/NoteEndpoints.cs b/exercise.wwwapi/Endpoints/NoteEndpoints.cs index 4e267fc..1d8a7a3 100644 --- a/exercise.wwwapi/Endpoints/NoteEndpoints.cs +++ b/exercise.wwwapi/Endpoints/NoteEndpoints.cs @@ -5,7 +5,6 @@ using exercise.wwwapi.Factories; using exercise.wwwapi.Helpers; using exercise.wwwapi.Models; -using exercise.wwwapi.Models.UserInfo; using exercise.wwwapi.Repository; using FluentValidation; using Microsoft.AspNetCore.Mvc; diff --git a/exercise.wwwapi/Endpoints/PostEndpoints.cs b/exercise.wwwapi/Endpoints/PostEndpoints.cs index 5e83573..241e4b8 100644 --- a/exercise.wwwapi/Endpoints/PostEndpoints.cs +++ b/exercise.wwwapi/Endpoints/PostEndpoints.cs @@ -88,7 +88,7 @@ private static async Task GetAllPosts(IRepository postRepository, ClaimsPrincipal user) { var results = (await postRepository.GetAllAsync( - p => p.Author.Profile, + p => p.Author, p => p.Comments )).ToList(); @@ -113,7 +113,7 @@ private static async Task GetAllPostsVol2(IRepository postReposit ClaimsPrincipal user) { var results = (await postRepository.GetAllAsync( - p => p.Author.Profile, + p => p.Author, p => p.Comments, p => p.Likes )).ToList(); diff --git a/exercise.wwwapi/Endpoints/SecureApi.cs b/exercise.wwwapi/Endpoints/SecureApi.cs index 5c94213..18556c7 100644 --- a/exercise.wwwapi/Endpoints/SecureApi.cs +++ b/exercise.wwwapi/Endpoints/SecureApi.cs @@ -1,9 +1,9 @@ using exercise.wwwapi.Helpers; +using exercise.wwwapi.Models; using exercise.wwwapi.Repository; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System.Security.Claims; -using exercise.wwwapi.Models.UserInfo; namespace exercise.wwwapi.EndPoints; diff --git a/exercise.wwwapi/Endpoints/UserEndpoints.cs b/exercise.wwwapi/Endpoints/UserEndpoints.cs index 9a2a7ab..76b4efe 100644 --- a/exercise.wwwapi/Endpoints/UserEndpoints.cs +++ b/exercise.wwwapi/Endpoints/UserEndpoints.cs @@ -14,8 +14,7 @@ using System.Text; using exercise.wwwapi.Enums; using exercise.wwwapi.Helpers; -using exercise.wwwapi.Models.UserInfo; -using User = exercise.wwwapi.Models.UserInfo.User; +using User = exercise.wwwapi.Models.User; using exercise.wwwapi.DTOs.Notes; using System.Diagnostics; using exercise.wwwapi.Models; @@ -43,12 +42,12 @@ public static void ConfigureAuthApi(this WebApplication app) private static async Task GetUsers(IRepository userRepository, string? searchTerm, ClaimsPrincipal claimPrincipal) { - var results = (await userRepository.GetAllAsync(u => u.Profile, u => u.Credential, u => u.Notes)).ToList(); + var results = (await userRepository.GetAllAsync(u => u.Notes)).ToList(); if (!string.IsNullOrWhiteSpace(searchTerm)) { results = results.Where(u => - u.Profile.GetFullName().Contains(searchTerm, StringComparison.OrdinalIgnoreCase)) + $"{u.FirstName} {u.LastName}".Contains(searchTerm, StringComparison.OrdinalIgnoreCase)) .ToList(); } var userRole = claimPrincipal.Role(); @@ -56,8 +55,8 @@ private static async Task GetUsers(IRepository userRepository, st var userData = new UsersSuccessDTO { - Users = results.Select(user => authorizedAsTeacher - ? UserFactory.GetUserDTO(user, PrivilegeLevel.Teacher) + Users = results.Select(user => authorizedAsTeacher + ? UserFactory.GetUserDTO(user, PrivilegeLevel.Teacher) : UserFactory.GetUserDTO(user, PrivilegeLevel.Student)) .ToList() }; @@ -69,11 +68,10 @@ private static async Task GetUsers(IRepository userRepository, st }; return TypedResults.Ok(response); } - [ProducesResponseType(StatusCodes.Status200OK)] private static async Task GetUsersByCohort(IRepository userRepository, int id, ClaimsPrincipal claimsPrincipal) { - var all = await userRepository.GetAllAsync(u => u.Profile, u => u.Credential, u => u.Notes); + var all = await userRepository.GetAllAsync(u => u.Notes); var results = all.Where(u => u.CohortId == id).ToList(); var userRole = claimsPrincipal.Role(); @@ -82,8 +80,8 @@ private static async Task GetUsersByCohort(IRepository userReposi var userData = new UsersSuccessDTO { Users = results.Select(user => authorizedAsTeacher - ? UserFactory.GetUserDTO(user, PrivilegeLevel.Teacher) - : UserFactory.GetUserDTO(user, PrivilegeLevel.Student)) + ? UserFactory.GetUserDTO(user, PrivilegeLevel.Teacher) + : UserFactory.GetUserDTO(user, PrivilegeLevel.Student)) .ToList() }; var response = new ResponseDTO @@ -119,9 +117,9 @@ private static async Task Register(RegisterRequestDTO request, IReposit } // Check if email already exists - var users = await userRepository.GetAllAsync(user => user.Credential + var users = await userRepository.GetAllAsync( ); - if (users.Any(u => u.Credential.Email == request.Email)) + if (users.Any(u => u.Email == request.Email)) { var failureDto = new RegisterFailureDTO(); failureDto.EmailErrors.Add("Email already exists"); @@ -148,24 +146,16 @@ private static async Task Register(RegisterRequestDTO request, IReposit var user = new User { - Credential = new Credential - { - Username = string.IsNullOrEmpty(request.Username) ? request.Email : request.Username, - PasswordHash = passwordHash, - Email = request.Email, - Role = Role.Student, - }, - Profile = new Profile - { - FirstName = string.IsNullOrEmpty(request.FirstName) ? string.Empty : request.FirstName, - LastName = string.IsNullOrEmpty(request.LastName) ? string.Empty : request.LastName, - Bio = string.IsNullOrEmpty(request.Bio) ? string.Empty : request.Bio, - Github = string.IsNullOrEmpty(request.Github) ? string.Empty : request.Github, - StartDate = DateTime.MinValue, - EndDate = DateTime.MinValue, - Specialism = Specialism.None, - }, - CohortId = request.CohortId + Username = string.IsNullOrEmpty(request.Username) ? request.Email : request.Username, + PasswordHash = passwordHash, + Email = request.Email, + Role = Role.Student, + FirstName = string.IsNullOrEmpty(request.FirstName) ? string.Empty : request.FirstName, + LastName = string.IsNullOrEmpty(request.LastName) ? string.Empty : request.LastName, + Mobile = string.IsNullOrEmpty(request.Mobile) ? string.Empty : request.Mobile, + Bio = string.IsNullOrEmpty(request.Bio) ? string.Empty : request.Bio, + Github = string.IsNullOrEmpty(request.Github) ? string.Empty : request.Github, + Specialism = Specialism.None }; userRepository.Insert(user); @@ -179,17 +169,14 @@ private static async Task Register(RegisterRequestDTO request, IReposit User = { Id = user.Id, - FirstName = user.Profile.FirstName, - LastName = user.Profile.LastName, - Bio = user.Profile.Bio, - Github = user.Profile.Github, - Username = user.Credential.Username, - Email = user.Credential.Email, - Phone = user.Profile.Phone, - StartDate = user.Profile.StartDate, - EndDate = user.Profile.EndDate, - Specialism = user.Profile.Specialism, - CohortId = user.CohortId + FirstName = user.FirstName, + LastName = user.LastName, + Bio = user.Bio, + Github = user.Github, + Username = user.Username, + Email = user.Email, + Mobile = user.Mobile, + Specialism = user.Specialism, } } }; @@ -202,11 +189,8 @@ private static async Task Register(RegisterRequestDTO request, IReposit private static async Task Login(LoginRequestDTO request, IRepository userRepository, IConfigurationSettings configurationSettings) { - var allUsers = await userRepository.GetAllAsync( - user => user.Credential, - user => user.Profile - ); - var user = allUsers.FirstOrDefault(u => u.Credential.Email == request.Email); + var allUsers = await userRepository.GetAllAsync(); + var user = allUsers.FirstOrDefault(u => u.Email == request.Email); if (user == null) { return Results.BadRequest(new Payload @@ -215,7 +199,7 @@ private static async Task Login(LoginRequestDTO request, IRepository { @@ -244,8 +228,6 @@ public static async Task GetUserById(IRepository userRepository, { var user = await userRepository.GetByIdAsync( id, - user => user.Credential, - user => user.Profile, user => user.Notes ); if (user == null) @@ -331,30 +313,26 @@ public static async Task UpdateUser(IRepository userRepository, i return Results.BadRequest(failResponse); } - var user = await userRepository.GetByIdAsync( - id, - user => user.Credential, - user => user.Profile - ); + + var user = await userRepository.GetByIdAsync(id); if (user == null) { return TypedResults.NotFound(); } - if (request.Username != null) user.Credential.Username = request.Username; - if (request.Email != null) user.Credential.Email = request.Email; + if (request.Username != null) user.Username = request.Username; + if (request.Email != null) user.Email = request.Email; if (request.Password != null) - user.Credential.PasswordHash = BCrypt.Net.BCrypt.HashPassword(request.Password); - if (request.Phone != null) user.Profile.Phone = request.Phone; - if (request.Bio != null) user.Profile.Bio = request.Bio; - if (request.Github != null) user.Profile.Github = GITHUB_URL + request.Github; - if (request.FirstName != null) user.Profile.FirstName = request.FirstName; - if (request.LastName != null) user.Profile.LastName = request.LastName; - if (request.CohortId != null) user.CohortId = request.CohortId; + user.PasswordHash = BCrypt.Net.BCrypt.HashPassword(request.Password); + if (request.Mobile != null) user.Mobile = request.Mobile; + if (request.Bio != null) user.Bio = request.Bio; + if (request.Github != null) user.Github = GITHUB_URL + request.Github; + if (request.FirstName != null) user.FirstName = request.FirstName; + if (request.LastName != null) user.LastName = request.LastName; if (request.Specialism != null) - user.Profile.Specialism = (Specialism)request.Specialism; + user.Specialism = (Specialism)request.Specialism; if (request.Role != null) - user.Credential.Role = (Role)request.Role; + user.Role = (Role)request.Role; userRepository.Update(user); await userRepository.SaveAsync(); @@ -365,18 +343,15 @@ public static async Task UpdateUser(IRepository userRepository, i Data = new UpdateUserSuccessDTO() { Id = user.Id, - Email = user.Credential.Email, - FirstName = user.Profile.FirstName, - LastName = user.Profile.LastName, - Bio = user.Profile.Bio, - Github = user.Profile.Github, - Username = user.Credential.Username, - Phone = user.Profile.Phone, - CohortId = user.CohortId, - Specialism = user.Profile.Specialism, - Role = user.Credential.Role, - StartDate = user.Profile.StartDate, - EndDate = user.Profile.EndDate + Email = user.Email, + FirstName = user.FirstName, + LastName = user.LastName, + Bio = user.Bio, + Github = user.Github, + Username = user.Username, + Mobile = user.Mobile, + Specialism = user.Specialism, + Role = user.Role, } }; @@ -396,11 +371,7 @@ public static async Task DeleteUser(IRepository userRepository, i return Results.Unauthorized(); } - var user = await userRepository.GetByIdAsync( - id, - user => user.Credential, - user => user.Profile - ); + var user = await userRepository.GetByIdAsync(id); if (user == null) { return TypedResults.NotFound(); @@ -423,9 +394,9 @@ private static string CreateToken(User user, IConfigurationSettings configuratio var claims = new List { new(ClaimTypes.Sid, user.Id.ToString()), - new(ClaimTypes.Name, user.Credential.Username), - new(ClaimTypes.Email, user.Credential.Email), - new(ClaimTypes.Role, user.Credential.Role.ToString()) + new(ClaimTypes.Name, user.Username), + new(ClaimTypes.Email, user.Email), + new(ClaimTypes.Role, user.Role.ToString()) }; var tokenKey = Environment.GetEnvironmentVariable(Globals.EnvironmentEnvVariable) == "Staging" diff --git a/exercise.wwwapi/Factories/UserFactory.cs b/exercise.wwwapi/Factories/UserFactory.cs index e055558..ed00d41 100644 --- a/exercise.wwwapi/Factories/UserFactory.cs +++ b/exercise.wwwapi/Factories/UserFactory.cs @@ -2,7 +2,6 @@ using exercise.wwwapi.DTOs.Notes; using exercise.wwwapi.Enums; using exercise.wwwapi.Models; -using exercise.wwwapi.Models.UserInfo; using System.Numerics; namespace exercise.wwwapi.Factories @@ -14,18 +13,15 @@ public static UserDTO GetUserDTO(User user, PrivilegeLevel privilegeLevel) var userDTO = new UserDTO() { Id = user.Id, - FirstName = user.Profile.FirstName, - LastName = user.Profile.LastName, - Bio = user.Profile.Bio, - Github = user.Profile.Github, - Username = user.Credential.Username, - Email = user.Credential.Email, - Phone = user.Profile.Phone, - StartDate = user.Profile.StartDate, - EndDate = user.Profile.EndDate, - Specialism = user.Profile.Specialism, - CohortId = user.CohortId, - Role = user.Credential.Role.ToString() + FirstName = user.FirstName, + LastName = user.LastName, + Bio = user.Bio, + Github = user.Github, + Username = user.Username, + Email = user.Email, + Mobile = user.Mobile, + Specialism = user.Specialism, + Role = user.Role.ToString() }; if (privilegeLevel == PrivilegeLevel.Teacher) diff --git a/exercise.wwwapi/Models/Cohort.cs b/exercise.wwwapi/Models/Cohort.cs index d3c1185..1c25612 100644 --- a/exercise.wwwapi/Models/Cohort.cs +++ b/exercise.wwwapi/Models/Cohort.cs @@ -1,6 +1,5 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using exercise.wwwapi.Models.UserInfo; namespace exercise.wwwapi.Models; diff --git a/exercise.wwwapi/Models/Comment.cs b/exercise.wwwapi/Models/Comment.cs index 4effc05..35b9f86 100644 --- a/exercise.wwwapi/Models/Comment.cs +++ b/exercise.wwwapi/Models/Comment.cs @@ -1,7 +1,6 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Text.Json.Serialization; -using exercise.wwwapi.Models.UserInfo; namespace exercise.wwwapi.Models; diff --git a/exercise.wwwapi/Models/Note.cs b/exercise.wwwapi/Models/Note.cs index 435e65a..883246f 100644 --- a/exercise.wwwapi/Models/Note.cs +++ b/exercise.wwwapi/Models/Note.cs @@ -1,5 +1,4 @@ -using exercise.wwwapi.Models.UserInfo; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Text.Json.Serialization; diff --git a/exercise.wwwapi/Models/Post.cs b/exercise.wwwapi/Models/Post.cs index 0c24f85..ccc5f9e 100644 --- a/exercise.wwwapi/Models/Post.cs +++ b/exercise.wwwapi/Models/Post.cs @@ -1,7 +1,6 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Text.Json.Serialization; -using exercise.wwwapi.Models.UserInfo; namespace exercise.wwwapi.Models; diff --git a/exercise.wwwapi/Models/User.cs b/exercise.wwwapi/Models/User.cs index f0d7497..59c14be 100644 --- a/exercise.wwwapi/Models/User.cs +++ b/exercise.wwwapi/Models/User.cs @@ -1,5 +1,4 @@ using exercise.wwwapi.Enums; -using exercise.wwwapi.Models.UserInfo; using Microsoft.EntityFrameworkCore; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/exercise.wwwapi/Program.cs b/exercise.wwwapi/Program.cs index 77093fd..0eb0f5f 100644 --- a/exercise.wwwapi/Program.cs +++ b/exercise.wwwapi/Program.cs @@ -16,7 +16,6 @@ using System.Text; using exercise.wwwapi; using exercise.wwwapi.Models; -using exercise.wwwapi.Models.UserInfo; using exercise.wwwapi.DTOs.Notes; using exercise.wwwapi.Validators.NoteValidators; using exercise.wwwapi.DTOs.Posts; @@ -33,8 +32,6 @@ // Register model repositories builder.Services.AddScoped, Repository>(); -builder.Services.AddScoped, Repository>(); -builder.Services.AddScoped, Repository>(); builder.Services.AddScoped, Repository>(); builder.Services.AddScoped, Repository>(); builder.Services.AddScoped, Repository>();