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:
2025-01-19 12:45:19 -08:00
commit 2fa9c6fa80
15 changed files with 276 additions and 0 deletions

23
survey-beta/Program.cs Normal file
View 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();