Rename Columns to ColumnName; add Attributes folder
Renamed the Columns property to ColumnName in EntityBaseOptions.cs, updating all references accordingly. Added an "Attributes" folder entry to ReC.Domain.csproj for future organization.
This commit is contained in:
@@ -6,4 +6,8 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Attributes\" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
public record EntityBaseOptions()
|
public record EntityBaseOptions()
|
||||||
{
|
{
|
||||||
public Dictionary<string, string> Columns { get; init; } = [];
|
public Dictionary<string, string> ColumnName { get; init; } = [];
|
||||||
|
|
||||||
public void EnsureProperties(IEnumerable<string> propertyNames)
|
public void EnsureProperties(IEnumerable<string> propertyNames)
|
||||||
{
|
{
|
||||||
var missingProperties = propertyNames.Except(Columns.Select(col => col.Key)).ToList();
|
var missingProperties = propertyNames.Except(ColumnName.Select(col => col.Key)).ToList();
|
||||||
|
|
||||||
if (missingProperties.Count != 0)
|
if (missingProperties.Count != 0)
|
||||||
throw new InvalidOperationException($"The following properties are not configured: {string.Join(", ", missingProperties)}");
|
throw new InvalidOperationException($"The following properties are not configured: {string.Join(", ", missingProperties)}");
|
||||||
|
|||||||
Reference in New Issue
Block a user