Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork0
License
NotificationsYou must be signed in to change notification settings
SimonCropp/SqlServer.Rules.EntityFramework
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
ExtendsVerify to allow snapshot testing with EntityFramework.
SeeMilestones for release notes.
CallEfRecording.EnableRecording() onDbContextOptionsBuilder.
varbuilder=newDbContextOptionsBuilder<SampleDbContext>();builder.UseSqlServer(connection);builder.EnableRecording();vardata=newSampleDbContext(builder.Options);
EnableRecording should only be called in the test context.
To start recording callEfRecording.StartRecording(). The results will be automatically included in verified file.
varcompany=newCompany{Name="Title"};data.Add(company);awaitdata.SaveChangesAsync();Recording.Start();awaitdata.Companies.Where(_=>_.Name=="Title").ToListAsync();awaitVerify();
Will result in the following verified file:
{ ef: { Type: ReaderExecutedAsync, HasTransaction: false, Text:SELECT [c].[Id], [c].[Name]FROM [Companies] AS [c]WHERE [c].[Name] = N'Title' }}Database designed byCreative Stall fromThe Noun Project.
About
No description, website, or topics provided.
Resources
License
Code of conduct
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.