Beispiel #1
0
 public static List <Inventory> GetInventoryByOwnerId(int id, InventoryOwnerType type = InventoryOwnerType.Player)
 {
     using (var db = new Database())
     {
         return(db.InventoryItems.Where(i => i.OwnerId == id && i.OwnerType == type).ToList());
     }
 }
Beispiel #2
0
 public static async Task <List <Inventory> > GetInventoryByOwnerIdAsync(int id, InventoryOwnerType type = InventoryOwnerType.Player)
 {
     using (var db = new Database())
     {
         return(await Task.Run(() =>
         {
             return db.InventoryItems.Where(i => i.OwnerId == id && i.OwnerType == type).ToList();
         }));
     }
 }