public async Task PutTechAsync(int id, Tech tech) { var techOrg = await _context.Teches.FindAsync(id); if (techOrg != null) { techOrg.Title = tech.Title; _context.Entry(techOrg).State = EntityState.Modified; await _context.SaveChangesAsync(); } }
public async Task PostTechAsync(Tech tech) { _context.Teches.Add(tech); await _context.SaveChangesAsync(); }
// 입력 public void AddTech(Tech model) => this.db.Execute("Insert Into Teches (Title) Values (@Title)", model);
// 입력 public void AddTech(Tech model) { string sql = "Insert Into Teches (Title) Values (@Title)"; var id = this.db.Execute(sql, model); }