Open navnforfun opened 2 months ago
Please, attach all scripts and command line commands
@denis-ivanov
program.cs
//Add services to the container.
builder.Services.AddDbContext<MyDbContext>(options =>
{
options.UseClickHouse();
});
The file MyDbContext.cs
I generated by this : dotnet ef dbcontext scaffold "Host=127.0.0.1;Port=8123;User=default;Password=;Database=db2;Compress=True;CheckCompressedHash=False;SocketTimeout=60000000;Compressor=lz4" EntityFrameworkCore.ClickHouse -o Models -c MyDbContext
The file UserController.cs
I scaffolded by VS 2022 feature
private readonly MyDbContext _context;
public UsersController(MyDbContext context)
{
_context = context;
}
// GET: api/Users
[HttpGet]
public async Task<ActionResult<IEnumerable<User>>> GetUsers()
{
return await _context.Users.OrderBy(u => u.Timestamp).ToListAsync();
}
This is the repo of my project: https://github.com/userforfun201/Clickhouse2Net
@denis-ivanov Can my bug I encountered be fixed?
@denis-ivanov Am I wrong somewhere? Could you guide me? Any help would be appreciated.
I had successfull scaffold model by EntityFrameworkCore.ClickHouse package and I use this code to get data from my clickhouse database
The result was
My real data was