Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

License

NotificationsYou must be signed in to change notification settings

SimonCropp/SqlServer.Rules.EntityFramework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SqlServer.Rules.EntityFramework

Build statusNuGet Status

ExtendsVerify to allow snapshot testing with EntityFramework.

SeeMilestones for release notes.

NuGet package

Enable

CallEfRecording.EnableRecording() onDbContextOptionsBuilder.

varbuilder=newDbContextOptionsBuilder<SampleDbContext>();builder.UseSqlServer(connection);builder.EnableRecording();vardata=newSampleDbContext(builder.Options);

snippet source |anchor

EnableRecording should only be called in the test context.

Usage

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();

snippet source |anchor

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'  }}

snippet source |anchor

Icon

Database designed byCreative Stall fromThe Noun Project.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Contributors2

  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp