Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Help please..connect or access the connection string in startup...

$
0
0

Please help me solve this issue...

How to I access my Asp.Net Core Startup file so for database connection from my Service Contract Class Library?

public partial class WebApp_Entity : DbContext
    {
        public WebApp_Entity()
            :base ()   <-- I need to connect or access the connection string that is located in the startup.
        { }

       OR

      public WebApp_Entity()
            :base ("name=DefaultConnection")   <-- Old way does not work - get an error message.
        { }

        public virtual DbSet<AppEntities.AspNetRoles> eAspNetRoles { get; set; }

        public virtual DbSet<AppEntities.AspNetUserClaims> eAspNetUserClaims { get; set; }
        
        
    }


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>