Convert db to EF Core; start on view page

Also returning skills with profile inquiries now, though that particular query is failing (current WIP) #2
This commit is contained in:
2021-01-06 23:18:54 -05:00
parent 97b3de1cea
commit ef12da01dc
26 changed files with 515 additions and 508 deletions

View File

@@ -3,5 +3,5 @@
/// <summary>
/// A transport mechanism to send counts across the wire via JSON
/// </summary>
public record Count(long Value);
public record Count(int Value);
}

View File

@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
namespace JobsJobsJobs.Shared.Api
{
@@ -74,7 +75,13 @@ namespace JobsJobsJobs.Shared.Api
RemoteWork = profile.RemoteWork,
FullTime = profile.FullTime,
Biography = profile.Biography.Text,
Experience = profile.Experience?.Text ?? ""
Experience = profile.Experience?.Text ?? "",
Skills = profile.Skills.Select(s => new SkillForm
{
Id = s.Id.ToString(),
Description = s.Description,
Notes = s.Notes
}).ToList()
};
}
}

View File

@@ -1,4 +1,5 @@
using NodaTime;
using System;
namespace JobsJobsJobs.Shared
{
@@ -21,5 +22,10 @@ namespace JobsJobsJobs.Shared
/// Navigation property for continent
/// </summary>
public Continent? Continent { get; set; }
/// <summary>
/// Convenience property for skills associated with a profile
/// </summary>
public Skill[] Skills { get; set; } = Array.Empty<Skill>();
}
}

View File

@@ -12,5 +12,15 @@ namespace JobsJobsJobs.Shared
/// </summary>
/// <returns>A new success report ID</returns>
public static async Task<SuccessId> Create() => new SuccessId(await ShortId.Create());
/// <summary>
/// Attempt to create a success report ID from a string
/// </summary>
/// <param name="id">The prospective ID</param>
/// <returns>The success report ID</returns>
/// <exception cref="System.FormatException">If the string is not a valid success report ID</exception>
public static SuccessId Parse(string id) => new SuccessId(ShortId.Parse(id));
public override string ToString() => Id.ToString();
}
}