You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
OptifitWebService/ConsoleTest/Program.cs

23 lines
703 B

using System;
using Infrastructure;
using Infrastructure.Entities;
using Infrastructure.Stub;
using Microsoft.Data.Sqlite;
using Microsoft.EntityFrameworkCore;
var connection = new SqliteConnection("DataSource=:memory:");
connection.Open();
var options = new DbContextOptionsBuilder<OptifitDbContext>()
.UseSqlite(connection)
.Options;
await using (var context = new StubbedContext(options))
{
Console.WriteLine("\n============Users============");
//Display all users
var users = await context.Users.ToListAsync();
Console.WriteLine("Diplay the Users: (Tolal:" + users.Count + ")");
foreach (var userEntity in users) Console.WriteLine(userEntity);
}
connection.Close();