api-server-setup #1

Merged
derek merged 37 commits from api-server-setup into main 2025-07-15 21:17:25 -07:00
Showing only changes of commit 8d5dbcabff - Show all commits
+50 -7
View File
@@ -150,6 +150,10 @@ namespace BoredCareers.Services.DatabaseService {
}
}
if (resume == null) {
return resume;
}
List<ResumeExperienceBullet> experienceBullets = new List<ResumeExperienceBullet>();
using (DbDataReader reader = await ResumeExperienceBulletReader) {
while (await reader.ReadAsync()) {
@@ -167,9 +171,7 @@ namespace BoredCareers.Services.DatabaseService {
}
}
Dictionary<int, List<ResumeExperienceBullet>> groupedExperienceBullets = experienceBullets
.GroupBy(b => b.ResumeExperienceID)
.ToDictionary(g => g.Key, g => g.ToList());
.GroupBy(b => b.ResumeExperienceID).ToDictionary(g => g.Key, g => g.ToList());
using (DbDataReader reader = await ResumeExperienceReader) {
List<ResumeExperience> experience = new List<ResumeExperience>();
while (await reader.ReadAsync()) {
@@ -187,7 +189,6 @@ namespace BoredCareers.Services.DatabaseService {
DateTime _datestarted = reader.GetDateTime("DateStarted");
bool _stillempoyed = reader.GetBoolean("StillEmployed");
DateTime _dateended = reader.GetDateTime("DateEnded");
experience.Add(new ResumeExperience() {
ID = _id,
ResumeID = _resumeid,
@@ -203,14 +204,56 @@ namespace BoredCareers.Services.DatabaseService {
ExperienceBullets = groupedExperienceBullets[_id].ToArray()
});
}
resume.Experience = experience.ToArray();
}
List<ResumeMilitaryBullet> militaryBullets = new List<ResumeMilitaryBullet>();
using (DbDataReader reader = await ResumeMilitaryBulletReader) {
while (await reader.ReadAsync()) {
if (reader == null) { break; }
int _id = reader.GetInt32("ID");
int _resumeid = reader.GetInt32("ResumeID");
int _experienceid = reader.GetInt32("ResumeMilitaryID");
string _achievement = reader.GetString("Achevement");
string _description = reader.GetString("Description");
militaryBullets.Add(new ResumeMilitaryBullet() {
ID = _id,
ResumeID = _resumeid,
ResumeMilitaryID = _experienceid,
Achevement = _achievement,
Description = _description
});
}
}
Dictionary<int, List<ResumeMilitaryBullet>> groupedMilitaryBullets = militaryBullets
.GroupBy(b => b.ResumeMilitaryID).ToDictionary(g => g.Key, g => g.ToList());
using (DbDataReader reader = await ResumeMilitaryReader) {
ResumeMilitary? military = null;
while (await reader.ReadAsync()) {
if (reader == null) {
break;
}
int _id = reader.GetInt32("ID");
int _resumeid = reader.GetInt32("ResumeID");
string _country = reader.GetString("Country");
string _rank = reader.GetString("Rank");
DateTime _datestarted = reader.GetDateTime("DateStarted");
bool _stillServing = reader.GetBoolean("StillServing");
DateTime _dateended = reader.GetDateTime("DateEnded");
military = new ResumeMilitary() {
ID = _id,
ResumeID = _resumeid,
Country = _country,
Rank = _rank,
DateStarted = _datestarted,
StillServing = _stillServing,
DateEnded = _dateended,
MillitaryBullets = groupedMilitaryBullets[_id].ToArray()
};
}
if (military != null) {
resume.Millitary = military;
}
}
using (DbDataReader reader = await ResumeEducationReader) {