mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 20:13:49 +00:00
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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user