public async Task <List <HelloWorld> > GetAllAsync() { using (var context = new HelloWorldDbContext()) { var result = await context.HelloWorlds.ToListAsync(); return(result); } }
public async Task <HelloWorld> CreateAsync(HelloWorld helloWorld) { using (var context = new HelloWorldDbContext()) { context.HelloWorlds.Add(helloWorld); await context.SaveChangesAsync(); return(helloWorld); } }