Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project>
<PropertyGroup>
<NoWarn>CS1591;CS0649;CS8632;EF1001;NU1608;NU1109</NoWarn>
<Version>15.0.0</Version>
<Version>15.0.1</Version>
<LangVersion>preview</LangVersion>
<AssemblyVersion>1.0.0</AssemblyVersion>
<PackageTags>EntityFramework, Verify</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
Type: ReaderExecutedAsync,
HasTransaction: false,
Text:
select companies.Id,
companies.Name,
employees.Id,
employees.Age,
employees.CompanyId,
employees.Name
from Companies as companies
select Companies.Id,
Companies.Name,
Employees.Id,
Employees.Age,
Employees.CompanyId,
Employees.Name
from Companies as Companies
left outer join
Employees as employees
on companies.Id = employees.CompanyId
order by companies.Name,
companies.Id
Employees as Employees
on Companies.Id = Employees.CompanyId
order by Companies.Name,
Companies.Id
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
select companies.Id,
companies.Name
from Companies as companies
where companies.Name = N'company name'
select Companies.Id,
Companies.Name
from Companies as Companies
where Companies.Name = N'company name'
12 changes: 5 additions & 7 deletions src/Verify.EntityFramework/DescriptiveSqlAliasManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@ class DescriptiveSqlAliasManager : SqlAliasManager

public override string GenerateTableAlias(string name)
{
var lowerName = name.ToLowerInvariant();

if (aliases.TryGetValue(lowerName, out var counter))
if (aliases.TryGetValue(name, out var counter))
{
aliases[lowerName] = counter + 1;
return lowerName + counter;
aliases[name] = counter + 1;
return name + counter;
}

aliases[lowerName] = 0;
return lowerName;
aliases[name] = 0;
return name;
}

protected override Dictionary<string, string>? RemapTableAliases(IReadOnlySet<string> usedAliases) =>
Expand Down
4 changes: 2 additions & 2 deletions src/Verify.EntityFramework/VerifyEntityFramework.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public static void IgnoreNavigationProperties(IModel? model = null)
throw new("The `model` parameter must be provided wither on this method or on VerifyEntityFramework.Enable()");
}

return GetNavigations(model);
return model.GetNavigations();
}

static IEnumerable<(Type type, string name)> GetNavigations(this IModel model)
Expand Down Expand Up @@ -190,4 +190,4 @@ public static void DisableRecording<TContext>(this TContext context)
internal static bool IsRecordingDisabled<TContext>(this TContext context)
where TContext : DbContext =>
recordingDisabledContextIds.Contains(context.ContextId.InstanceId);
}
}