shoppinglistdbaccess comments
This commit is contained in:
parent
fe90c243e2
commit
dee0ea54a2
@ -14,6 +14,8 @@ namespace API.DBAccess
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
// Read the shoppinglist connected to the user
|
||||
public async Task<User> ReadShoppingList(int userId)
|
||||
{
|
||||
var user = await _context.Users.Include(u => u.ShoppingList).FirstOrDefaultAsync(u => u.Id == userId);
|
||||
@ -21,6 +23,7 @@ namespace API.DBAccess
|
||||
return user;
|
||||
}
|
||||
|
||||
// Updates the shoppinglist
|
||||
public async Task<IActionResult> UpdateShoppingList(User user)
|
||||
{
|
||||
_context.Entry(user).State = EntityState.Modified;
|
||||
|
Loading…
Reference in New Issue
Block a user