BanaxFamily / CampusCore

UC-CCS CampusCore: A Secure Digital Repository as Knowledge Management System
0 stars 0 forks source link

API - clean up #70

Open shaiweeeen opened 10 months ago

shaiweeeen commented 10 months ago

Be mindful not all needs Include.

We don't want to return data that will not be used. Analyze the system, if you are unsure, just create an issue and label: bug ... title should be API-Include: [add very short description] and I will review.

This is without Role implementation yet

shaiweeeen commented 10 months ago

@xlawan kani lng nya unaha

xlawan commented 10 months ago

Modified Services and Controllers:

Announcement AnnouncementComment Course CourseEnrollment Issue

xlawan commented 10 months ago

Checked and modified messages and applied GeneralViewModel on these files: IssueComment - was not able to test (can't add data to the database yet) OfferedCourse PublicResearchRepository - was not able to test (can't add data to the database yet)

These files was changed to display joined tables: Announcement AnnouncementComment IssueComment

xlawan commented 10 months ago

Modified to show Foreign keys: User PublicResearchRepository Issue

Modified to connect with GeneralViewModel PublicResearchRepository

shaiweeeen commented 10 months ago

This is how to query specific properties from tables with foreign keys and navigators: var result = await _context.UserLogs .Select(x => new { UserId = x.User.Id, UserName = x.User.UserName, Idno = x.User.Idno, FullName = x.User.FullName, UserLogId = x.Id, // Include other properties from UserLog entity as needed }) .ToListAsync();