//toevoegen public static int AddPlayerInventoryItem(Inventory_Item inventoryitem) { using (MinecraftEntities entities = new MinecraftEntities()) { entities.Inventory_Item.Add(inventoryitem); return(entities.SaveChanges()); } }
//toevoegen public static int AddInventory(Inventory inventory) { using (MinecraftEntities entities = new MinecraftEntities()) { entities.Inventory.Add(inventory); return(entities.SaveChanges()); } }
//toevoegen public static int AddServer(Server server) { using (MinecraftEntities entities = new MinecraftEntities()) { entities.Server.Add(server); return(entities.SaveChanges()); } }
//Update inventoryitems public static int UpdateInventoryItem(Inventory_Item invItem) { using (MinecraftEntities entities = new MinecraftEntities()) { entities.Entry(invItem).State = EntityState.Modified; return(entities.SaveChanges()); } }
/*===================== * Recipes * =====================*/ //toevoegen public static int AddPlayerRecipe(Player_Recipe playerrecipe) { using (MinecraftEntities entities = new MinecraftEntities()) { entities.Player_Recipe.Add(playerrecipe); return(entities.SaveChanges()); } }
//Update public static int UpdatePlayerRecipe(Player_Recipe recipe) { using (MinecraftEntities entities = new MinecraftEntities()) { entities.Entry(recipe).State = EntityState.Modified; return(entities.SaveChanges()); } }
/*===================== * Advancement * =====================*/ //toevoegen public static int AddPlayerAdvancement(Player_Advancement player_advancement) { using (MinecraftEntities entities = new MinecraftEntities()) { entities.Player_Advancement.Add(player_advancement); return(entities.SaveChanges()); } }
/*===================== * WorldSetting * =====================*/ //toevoegen public static int AddWorldSetting(World_Setting world_setting) { using (MinecraftEntities entities = new MinecraftEntities()) { entities.World_Setting.Add(world_setting); return(entities.SaveChanges()); } }
//toevoegen public static int AddPlayer(Player player) { using (MinecraftEntities entities = new MinecraftEntities()) { entities.Player.Add(player); return(entities.SaveChanges()); } }
//updaten public static int UpdateSpeler(Player player) { using (MinecraftEntities entities = new MinecraftEntities()) { entities.Entry(player).State = EntityState.Modified; return(entities.SaveChanges()); } }
/*===================== * Dimension * =====================*/ //toevoegen public static int AddDimension(Dimension dimension) { using (MinecraftEntities entities = new MinecraftEntities()) { entities.Dimension.Add(dimension); return(entities.SaveChanges()); } }
//Updaten public static int UpdateWorldSetting(World_Setting worldsetting) { using (MinecraftEntities entities = new MinecraftEntities()) { entities.Entry(worldsetting).State = EntityState.Modified; return(entities.SaveChanges()); } }
//verwijderen public static int RemoveWorldSetting(World_Setting world_setting) { using (MinecraftEntities entities = new MinecraftEntities()) { entities.Entry(world_setting).State = EntityState.Deleted; return(entities.SaveChanges()); } }
//updaten public static int UpdateServer(Server server) { using (MinecraftEntities entities = new MinecraftEntities()) { entities.Entry(server).State = EntityState.Modified; return(entities.SaveChanges()); } }
//Update public static int UpdatePlayerAdvancement(Player_Advancement advancement) { using (MinecraftEntities entities = new MinecraftEntities()) { entities.Entry(advancement).State = EntityState.Modified; return(entities.SaveChanges()); } }
//toevoegen public static int AddWorld(World world) { using (MinecraftEntities entities = new MinecraftEntities()) { entities.World.Add(world); return(entities.SaveChanges()); } }
//verwijderen public static int RemoveServer(Server server) { using (MinecraftEntities entities = new MinecraftEntities()) { var query = entities.Server .Include(x => x.World) .Where(x => x.id == server.id) .SingleOrDefault(); entities.World.Remove(query.World); entities.Server.Remove(query); return(entities.SaveChanges()); } }