skip to Main Content

Unable to resolve service DbContext while attempting to activate controller – Asp.net

I have my own DbContext: public class DreamsContext : DbContext { public DbSet<UserAccount> UserAccounts { get; set; } public DbSet<DreamPublication> DreamPublications { get; set; } public DreamsContext(DbContextOptions<DreamsContext> options) : base(options) { } protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity<UserAccount>().ToTable("dreams_user"); modelBuilder.Entity<DreamPublication>().ToTable("dream_publications");…

VIEW QUESTION

Configure all options derived from base option class or interface .NET Core – Asp.net

I have code with variables in appsettings.json file so I register all options in IServiceCollection via configure method: public static void Configure(IServiceCollection services, IConfiguration configuration, bool useHangfire = true) { services .Configure<AuthSettings>(configuration.GetSection(AuthSettings.SectionName)) .Configure<CacheSettings>(configuration.GetSection(CacheSettings.SectionName)) ..... and so on I would like…

VIEW QUESTION

Android Studio – Execution failed for task ':app:kaptDebugKotlin' – Error Occurs while using Hilt

Added hilt dependencies: Build.gradle(project) def hilt_version = "2.38.1" classpath "com.google.dagger:hilt-android-gradle-plugin:$hilt_version" Build.gradle(app) plugins { id 'dagger.hilt.android.plugin' .... } .... dependencies { implementation "com.google.dagger:hilt-android:2.38.1" kapt "com.google.dagger:hilt-compiler:2.38.1" ....... } I also have a global application class: MyApplication.kt @HiltAndroidApp class MyApplication : Application() In…

VIEW QUESTION
Back To Top
Search