GFlisch / Arc4u.Guidance.Doc

Other
5 stars 1 forks source link

(Bug, guidance 2022.2.1.9, 04/11/2022) Adding a database layer doesn't include the project reference in the Host assembly #84

Closed vvdb-architecture closed 1 year ago

vvdb-architecture commented 1 year ago

When adding a dabase layer, the Program.cs is modified to contain the correct initialization:

    services.AddDbContextPool<Elia.Solution.Service.Database.DatabaseContext>(optionsBuilder =>
    {
        optionsBuilder.UseSqlServer(Configuration.GetConnectionString("Solution_Service"),
                                    (options) =>
                                    {
                                        options.CommandTimeout(30);
                                    })
                       .UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking);
    });

This will not compile, because the Solution.Service.Database project is not added as a reference to Solution.Service.Host project.

GFlisch commented 1 year ago

missing await when adding the reference => will add this in the current sprint for 1.10.