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:
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user