feat: Implement database schema, relationships and models for survey application
- Designed an ERD (Entity-Relationship Diagram) for the survey system. - Defined entities: User, Survey, Question, Choice, Response, and Answer. - Established relationships: - Users can author multiple surveys. - Surveys contain multiple questions. - Questions have multiple choices. - Surveys can have multiple responses from participants. - Responses are linked to answers, questions, and choices. - Ensured compliance with best practices for relational database design. Note : no migration yet
This commit is contained in:
23
survey-beta/Program.cs
Normal file
23
survey-beta/Program.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using survey_beta.DataBaseContext;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Add services to the container
|
||||
builder.Services.AddDbContext<AppDbContext>(options =>
|
||||
options.UseNpgsql(builder.Configuration.GetConnectionString("DefaultConnection")));
|
||||
|
||||
builder.Services.AddControllers();
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
|
||||
app.UseAuthorization();
|
||||
|
||||
app.MapControllers();
|
||||
|
||||
app.Run();
|
||||
Reference in New Issue
Block a user