not working inventory :c
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using PetCompanion.Data;
|
||||
using PetCompanion.Models;
|
||||
|
||||
namespace PetCompanion.Repositories
|
||||
{
|
||||
public class GameItemsRepository
|
||||
{
|
||||
private readonly ApplicationDbContext _context;
|
||||
|
||||
public GameItemsRepository(ApplicationDbContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
public GameItem GetById(int id)
|
||||
{
|
||||
return _context.GameItems.Find(id);
|
||||
}
|
||||
|
||||
public void Add(GameItem item)
|
||||
{
|
||||
_context.GameItems.Add(item);
|
||||
_context.SaveChanges();
|
||||
}
|
||||
|
||||
public void Update(GameItem item)
|
||||
{
|
||||
_context.GameItems.Update(item);
|
||||
_context.SaveChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user