I, as the developer, will need to install the required dependencies to manipulate and call upon Entity Framework as well as PostgreSQL functionality.
Acceptance Criteria
An ERD must be created as a stable foundation for the rest of the backend development, issue ticket creation, and API creation.
PostGreSQL as well as Entity Framework must be installed.
A repo will need to be initialized.
Issue Tickets/PR ticket templates must be added.
Dependencies
These extensions can be installed and implemented before or after test data is seeded. The ERD will need to be created as soon as MVP requirements are understood.
dotnet user-secrets set "DbConnectionString" "Host=localhost;Port=5432;Username=postgres;Password=;Database=CreekRiver"
- Program.cs Modifications:
using Microsoft.EntityFrameworkCore;
using System.Text.Json.Serialization;
using Microsoft.AspNetCore.Http.Json;
// ADDED ABOVE var app = builder.Build()
// allows passing datetimes without time zone data
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
// allows our api endpoints to access the database through Entity Framework Core
builder.Services.AddNpgsql(builder.Configuration["CreekRiverDbConnectionString"]);
// Set the JSON serializer options
builder.Services.Configure(options =>
{
options.SerializerOptions.ReferenceHandler = ReferenceHandler.IgnoreCycles;
});
User Story
Acceptance Criteria
Dependencies
Dev Notes
dotnet add package Microsoft.EntityFrameworkCore.Design --version 6.0
dotnet user-secrets init
dotnet user-secrets set "DbConnectionString" "Host=localhost;Port=5432;Username=postgres;Password=;Database=CreekRiver"
using Microsoft.EntityFrameworkCore; using System.Text.Json.Serialization; using Microsoft.AspNetCore.Http.Json;
// ADDED ABOVE var app = builder.Build() // allows passing datetimes without time zone data AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
// allows our api endpoints to access the database through Entity Framework Core builder.Services.AddNpgsql(builder.Configuration["CreekRiverDbConnectionString"]);
// Set the JSON serializer options builder.Services.Configure(options =>
{
options.SerializerOptions.ReferenceHandler = ReferenceHandler.IgnoreCycles;
});
builder.Services.AddCors(options => { options.AddDefaultPolicy(policy => { policy.WithOrigins("http://localhost:3000") .AllowAnyOrigin() .AllowAnyMethod() .AllowAnyHeader(); }); });
//ADDED AFTER BUILD app.UseCors();