insta_pr_decline.md
· 460 B · Markdown
原始文件
1. N+1 Queries
```C#
foreach (var item in items)
{
await _context.Items.FirstOrDefaultAsync(x => x.Id == item.id);
// Logic
await _context.SaveChangesAsync();
}
```
2. 3+ Includes without AsSplitQuery()
```C#
_context.Users
.Include(u => u.Roles)
.Include(u => u.Events)
.Include(u => u.Installations)
.ThenInclude(i => i.Meters)
.ToListAsync();
```
3. Todos without issues
```C#
var theThing = getTheThing(); // TODO: Do the right thing!
```
- N+1 Queries
foreach (var item in items)
{
await _context.Items.FirstOrDefaultAsync(x => x.Id == item.id);
// Logic
await _context.SaveChangesAsync();
}
- 3+ Includes without AsSplitQuery()
_context.Users
.Include(u => u.Roles)
.Include(u => u.Events)
.Include(u => u.Installations)
.ThenInclude(i => i.Meters)
.ToListAsync();
- Todos without issues
var theThing = getTheThing(); // TODO: Do the right thing!