public IActionResult Post([FromBody] User user) { if (user == null) { return(BadRequest()); } db.usr.Add(user); db.SaveChanges(); return(Ok(user)); }
public UserController(DbTables context) { this.db = context; if (!db.usr.Any()) { db.usr.Add(new User { login = "******", pass_hash = "1hher4" }); db.SaveChanges(); } }