[HttpGet("list")]
public async Task<IEnumerable<Person>> GetList()
{
using (var db = new ApplicationContext())
{
return await db.Persons.ToArrayAsync();
}
}
[HttpPut("create")]
public async Task Create(Person newModel)
{
using (var db = new ApplicationContext())
{
db.Persons.Add(newModel);
await db.SaveChangesAsync();
}
}