Enhance state management in DTOs and entities

- Added `States` property to `ProfileObjStateDto` and `ObjectDto`.
- Updated `MappingProfile` to include new `States` mapping.
- Made `StateId` in `ProfileObjState` required and added `State1` navigation property.
- Changed `ProfileObject` to use `States` instead of `State`.
- Cleaned up `State` class structure and removed redundant namespaces.
- Updated `ProfileObjRepository` to fetch related state data.
This commit is contained in:
2025-08-01 02:50:19 +02:00
parent 7309b968fe
commit ad023b01d3
7 changed files with 36 additions and 43 deletions

View File

@@ -35,6 +35,6 @@ public class ProfileObjRepository : IProfileObjRepository
public async Task<IEnumerable<ProfileObject>> ReadAsync(int userId, int profileId, CancellationToken cancel = default)
=> await _context.Objects
.FromSqlRaw("SELECT * FROM [FNMWF_GET_PROFILE_OBJECTS] ({0}, {1})", userId, profileId)
.Include(obj => obj.State)
.Include(obj => obj.States).ThenInclude(objState => objState.State1)
.ToListAsync(cancel);
}