forked from MDCPS/DamageAssessment_Backend
		
	
		
			
				
	
	
		
			20 lines
		
	
	
		
			737 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			737 B
		
	
	
	
		
			C#
		
	
	
	
	
	
| using Microsoft.EntityFrameworkCore;
 | |
| 
 | |
| namespace DamageAssesment.Api.SurveyResponses.Db
 | |
| {
 | |
|     public class SurveyResponseDbContext:DbContext
 | |
|     {
 | |
|         private IConfiguration _Configuration { get; set; }
 | |
|         public SurveyResponseDbContext(DbContextOptions options, IConfiguration configuration) : base(options)
 | |
|         {
 | |
|             _Configuration = configuration;
 | |
|         }
 | |
|         protected override void OnConfiguring(DbContextOptionsBuilder options)
 | |
|         {
 | |
|             // connect to sql server with connection string from app settings
 | |
|             options.UseSqlServer(_Configuration.GetConnectionString("SurveyResponseConnection"));
 | |
|         }
 | |
|         public DbSet<Db.SurveyResponse> SurveyResponses { get; set; }
 | |
|     }
 | |
| }
 |