|
Last change
on this file since 1d32d5c was c0256f3, checked in by stefansaveski <stefansaveski19@…>, 11 months ago |
|
Add user-related entities and enforce one-to-one mappings
Enhanced the User model with new entities: ContactInfo,
EnrollmentInfo, and HighSchool, establishing one-to-one
relationships. Updated UserDTO with additional fields and
introduced enums for type, quota, and major. Modified
UserRepository and AuthService to handle new entities.
Updated database schema with unique constraints on UserId
for related tables and added EF Core migration
20251027191028_dbRelations. Adjusted JSON serialization
to prevent circular references.
|
-
Property mode
set to
100644
|
|
File size:
715 bytes
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
|
|---|
| 3 | namespace iknow_api.Models
|
|---|
| 4 | {
|
|---|
| 5 | public enum UserRole
|
|---|
| 6 | {
|
|---|
| 7 | Admin,
|
|---|
| 8 | Professor,
|
|---|
| 9 | Strudent
|
|---|
| 10 | }
|
|---|
| 11 |
|
|---|
| 12 | public class User
|
|---|
| 13 | {
|
|---|
| 14 | public int Id { get; set; }
|
|---|
| 15 | public string? Name { get; set; }
|
|---|
| 16 | public string? Surname { get; set; }
|
|---|
| 17 | public string? Index { get; set; }
|
|---|
| 18 | public string? Email { get; set; }
|
|---|
| 19 | public string? PasswordHash { get; set; }
|
|---|
| 20 | public DateTime Bday { get; set; }
|
|---|
| 21 | public DateTime CreatedAt { get; set; }
|
|---|
| 22 | public UserRole Role { get; set; }
|
|---|
| 23 | public HighSchool? HighSchool { get; set; }
|
|---|
| 24 | public ContactInfo? ContactInfo { get; set; }
|
|---|
| 25 | public EnrollmentInfo? EnrollmentInfo { get; set; }
|
|---|
| 26 |
|
|---|
| 27 | }
|
|---|
| 28 | } |
|---|
Note:
See
TracBrowser
for help on using the repository browser.