public ActionResult Get(string nameHero) { var heroi = new Heroi { Nome = nameHero }; _context.Add(heroi); _context.SaveChanges(); return(Ok()); }
/// <summary> /// /// </summary> /// <typeparam name="T"></typeparam> /// <param name="entity"></param> /// <remarks></remarks> public void Add <T>(T entity) where T : class { _context.Add(entity); }
public async Task InsertAsync(Heroi heroi) { _context.Add(heroi); await _context.SaveChangesAsync(); }
public ActionResult Post([FromBody] Heroi h) { _context.Add(h); _context.SaveChanges(); return(new ObjectResult(h)); }