LightNap makes use of Entity Framework (EF) for database access. The ApplicationDbContext
and supporting entities are all kept in the Data
folder of the LightNap.Core
project.
Extending EF Models
Follow the common EF processes to ensure the changes are correctly integrated:
- Add/Update Entity Classes: Create or edit new classes in the
Entities
folder that represent the new entities. - Update DbContext: Add
DbSet<TEntity>
properties to theApplicationDbContext
class for each new entity. - Configure Relationships: Define relationships and constraints using Fluent API or data annotations in your entity classes.
- Migrations: Use EF Core migrations to update the database schema.
By following these steps, you can effectively extend the data model to meet your application’s requirements.