How to use your library?
Hello!) I'm trying to implement your library into my project, but I can't install it. Help me please. Are there any examples of how to install it?
public class HistoryDbContext : Microsoft.EntityFrameworkCore.DbContext
{
#region Constructors
/// <inheritdoc />
public HistoryDbContext(DbContextOptions<HistoryDbContext> options) : base(options)
{
}
#endregion
#region DbSets
public DbSet<ChangeHistory> ChangeHistory { get; set; }
#endregion
}
public class HistoryDbContextDesignTimeFactory : IDesignTimeDbContextFactory<HistoryDbContext>
{
/// <inheritdoc />
public HistoryDbContext CreateDbContext(string[] args) => CreateDbContext("_");
public HistoryDbContext CreateDbContext(string connectionString)
{
var optionsBuilder = new DbContextOptionsBuilder<HistoryDbContext>();
optionsBuilder.UseClickHouse(connectionString)
.ReplaceService<IMigrationsIdGenerator, MigrationsIdGenerator>()
.UseLoggerFactory(LoggerFactory.Create(builder => builder.AddConsole()));
return new HistoryDbContext(optionsBuilder.Options);
}
}
dotnet ef migrations add Migration00001 --context HistoryDbContext --project SkinTrove.DataAccess.ClickHouse --startup-project DatabaseMigrator
Unable to resolve service for type 'Microsoft.EntityFrameworkCore.Design.IAnnotationCodeGenerator' while attempting to activate 'Microsoft.EntityFrameworkCore.Migrations.Design.MigrationsCodeGeneratorDependencies'.
Hi, @RedPowDan ! The library is not implemented completely, that's why you will get error messages. Leave full example how to reproduce the issue, may I will find free time in the future.
Hi, @denis-ivanov!) Thank you very much for adding the description in Readme, I’ll return to the clickhouse problem in the near future!
Last changes still do not support migrations, you can generate them, but not apply, scaffolding should work
@RedPowDan, can you try latest version?
@RedPowDan, can you try latest version?
Hi!) Yes, I tried the latest version, but I don't use the library on my project yet, because there is no need to write information to ClickHouse right now, I only want to store the history of user actions there
@denis-ivanov, Can you please tell me where it is better to rent ClickHouse for a small amount for a test server?