public async Task <ActionResult <RecipeTable> > PostRecipe(RecipeTable recipe) { _context.RecipeTables.Add(recipe); await _context.SaveChangesAsync(); return(CreatedAtAction("GetRecipe", new { id = recipe.RecipeTableId }, recipe)); }
public async Task <IActionResult> PutRecipe(int id, RecipeTable recipe) { if (id != recipe.RecipeTableId) { return(BadRequest()); } _context.Entry(recipe).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RecipeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
protected override void LoadState() { var contents = FileContents; sequence = contents.Select(s => s.GetNumericValueInteger()).ToArray(); recipeCount = contents.ParseInt32(); table = new(); }
private async Task _LoadDataTables() { Task[] loaders = new Task[] { Task.Run(() => _versions = new VersionTable()), Task.Run(() => _colors = new ColorTable()), Task.Run(() => _items = new ItemTable()), Task.Run(() => _recipes = new RecipeTable()), Task.Run(() => _researchs = new ResearchTable()), Task.Run(() => _schematics = new SchematicTable()), }; await Task.WhenAll(loaders); }
public virtual void DeleteIngredient(RecipeTable entity) { //RecipeTable itemToDelete = se.RecipeTable.Local.Single(x => x.IdSoap == entity.IdSoap && x.IdIngredient == entity.IdIngredient && x.Quantity == entity.Quantity); //se.RecipeTable.Remove(itemToDelete); //se.SaveChanges(); }
protected override void ResetState() { table = null; }
public void Start() { Console.Title = "L2dotNET Gameserver"; CLogger.form(); Cfg.init("all"); CharTemplateTable.Instance.Initialize(); NetworkBlock.Instance.Initialize(); GameTime.Instance.Initialize(); IdFactory.Instance.Initialize(); L2World.Instance.Initialize(); MapRegionTable.Instance.Initialize(); ZoneTable.Instance.Initialize(); NpcTable.Instance.Initialize(); NpcData.getInstance(); // SpawnTable.getInstance(); // TSkillTable.getInstance(); ItemTable.getInstance(); ItemHandler.getInstance(); MultiSell.getInstance(); Capsule.getInstance(); RecipeTable.getInstance(); AIManager.getInstance(); BlowFishKeygen.GenerateKeys(); CLogger.info("Generated 20 Blowfish Keys"); AdminAccess.Instance.Initialize();; QuestManager.getInstance(); AnnouncementManager.Instance.Initialize(); AllianceTable.getInstance(); ClanTable.getInstance(); CLogger.info("NpcServer: "); StaticObjTable.Instance.Initialize(); MonsterRace.Instance.Initialize(); // SpawnTable.getInstance().Spawn(); StructureTable.Instance.Initialize(); HtmCache.Instance.Initialize(); AuthThread.Instance.Initialize(); // GeoData.getInstance(); CLogger.extra_info("Listening Gameservers on port " + Cfg.SERVER_PORT); _listener = new TcpListener(IPAddress.Any, Cfg.SERVER_PORT); _listener.Start(); TcpClient clientSocket = default(TcpClient); while (true) { clientSocket = _listener.AcceptTcpClient(); Accept(clientSocket); } }