Base solution for your next web application

Activities of "hjpetzer"

Hi Support,

Is authentication via OpenId Connect supported in the ASP.NET Core & Angular, 5.0.2 version? Specifically when using Azure Active Directory as Identity server. If so, how do I go about enabling it?

With version 4.6, I used my own solution to log in via Azure AD, but it was a bit buggy. I would like to use the official version if possible. Any help on this topic will be much appreciated!

Thanks hjpetzer

I've now implemented a separate project with a module and configured the db context in the PreInitialize() method. This is now working, so non issue :)

Dear Support,

I have the need to read/write to multiple databases with Entity Framework Core. I've search through this forums and read through the documentation, but still need some guidance ons best practises and a bit of support.

So for starters, just to ty and get it working, here is what I did.

  1. I've created a new DbContext in *.EntityFrameworkCore project:
public partial class AbpDpmDbContext : DpmDbContextBase
    {
        public AbpDpmDbContext(DbContextOptions<DpmDbContext> options) : base(options)
        {
        }
    }

This extends DpmDbContextBase that is in one for our NuGet packages. I've updated DpmDbContextBase to extend AbpDbContext and implement OnModelCreating:

public abstract class DpmDbContextBase : AbpDbContext
    {
        protected DpmDbContextBase(DbContextOptions options) : base(options)
        {
        }

        public virtual DbSet<Client> Clients { get; set; }
        ....
        <more DbSets>
        ....

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
           modelBuilder.Entity<Client>(entity =>
            {
                 ...
  1. In the application layer, I've created a basic service and a repository for one of the entities.

At this point, If I run the host, I can see the new entry point on the swagger interface and the repository is injected successfully, but I get an exception when the actual query is done:

Abp.AbpException: Could not resolve DbContextOptions for .....EntityFrameworkCore.Dpm.AbpDpmDbContext

I guess this has something to do with the wrong connection string. How do I set the DbContextOptions of my new DbContext?

Should I rather create a new module and make PortalWebCoreModule depend on it?

Thanks in advance for any help.

Showing 1 to 3 of 3 entries