api-server-setup #1
@@ -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,8 +189,7 @@ namespace BoredCareers.Services.DatabaseService {
|
||||
DateTime _datestarted = reader.GetDateTime("DateStarted");
|
||||
bool _stillempoyed = reader.GetBoolean("StillEmployed");
|
||||
DateTime _dateended = reader.GetDateTime("DateEnded");
|
||||
|
||||
experience.Add( new ResumeExperience() {
|
||||
experience.Add(new ResumeExperience() {
|
||||
ID = _id,
|
||||
ResumeID = _resumeid,
|
||||
JobTitle = _jobtitle,
|
||||
@@ -201,16 +202,58 @@ namespace BoredCareers.Services.DatabaseService {
|
||||
StillEmployed = _stillempoyed,
|
||||
DateEnded = _dateended,
|
||||
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
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
using (DbDataReader reader = await ResumeMilitaryBulletReader) {
|
||||
|
||||
}
|
||||
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user