Refactor user entities and repositories, update seeders

Standardized property naming in user-related entities to use 'Id' suffix (e.g., UserAccountId). Moved and updated repository interfaces and implementations to the DataAccessLayer.Repositories namespace. Refactored DBSeed seeders to use repository classes and improved structure. Updated .gitignore and project references
This commit is contained in:
Aaron Po
2026-01-15 13:23:41 -05:00
parent 60ef65ec52
commit b8cd855916
16 changed files with 660 additions and 760 deletions

View File

@@ -65,15 +65,15 @@ namespace WebAPI.Controllers
[HttpPost]
public IActionResult CreateUser([FromBody] UserAccount userAccount)
{
if (userAccount.UserAccountID == Guid.Empty)
if (userAccount.UserAccountId == Guid.Empty)
{
userAccount.UserAccountID = Guid.NewGuid();
userAccount.UserAccountId = Guid.NewGuid();
}
_userService.Add(userAccount);
return CreatedAtAction(
nameof(GetUserById),
new { id = userAccount.UserAccountID },
new { id = userAccount.UserAccountId },
userAccount
);
}
@@ -85,14 +85,14 @@ namespace WebAPI.Controllers
)
{
if (
userAccount.UserAccountID != Guid.Empty
&& userAccount.UserAccountID != id
userAccount.UserAccountId != Guid.Empty
&& userAccount.UserAccountId != id
)
{
return BadRequest("UserAccountID does not match route id.");
}
userAccount.UserAccountID = id;
userAccount.UserAccountId = id;
_userService.Update(userAccount);
return NoContent();
}

View File

@@ -1,5 +1,6 @@
using BusinessLayer.Services;
using DataAccessLayer;
using DataAccessLayer.Repositories;
var builder = WebApplication.CreateBuilder(args);