File tree Expand file tree Collapse file tree 14 files changed +24
-24
lines changed
LinkDotNet.Blog.Infrastructure/Persistence
LinkDotNet.Blog.Web/Features
LinkDotNet.Blog.IntegrationTests
LinkDotNet.Blog.UnitTests/Web/Features/Components Expand file tree Collapse file tree 14 files changed +24
-24
lines changed Original file line number Diff line number Diff line change @@ -39,12 +39,12 @@ public ValueTask<IPagedList<TProjection>> GetAllByProjectionAsync<TProjection>(
39
39
{
40
40
ArgumentNullException . ThrowIfNull ( selector ) ;
41
41
var result = entities . AsEnumerable ( ) ;
42
- if ( filter != null )
42
+ if ( filter is not null )
43
43
{
44
44
result = result . Where ( filter . Compile ( ) ) ;
45
45
}
46
46
47
- if ( orderBy != null )
47
+ if ( orderBy is not null )
48
48
{
49
49
result = descending
50
50
? result . OrderByDescending ( orderBy . Compile ( ) )
@@ -64,7 +64,7 @@ public ValueTask StoreAsync(TEntity entity)
64
64
}
65
65
66
66
var entry = entities . SingleOrDefault ( b => b . Id == entity . Id ) ;
67
- if ( entry != null )
67
+ if ( entry is not null )
68
68
{
69
69
entities . Remove ( entry ) ;
70
70
}
@@ -76,7 +76,7 @@ public ValueTask StoreAsync(TEntity entity)
76
76
public ValueTask DeleteAsync ( string id )
77
77
{
78
78
var blogPostToDelete = entities . SingleOrDefault ( b => b . Id == id ) ;
79
- if ( blogPostToDelete != null )
79
+ if ( blogPostToDelete is not null )
80
80
{
81
81
entities . Remove ( blogPostToDelete ) ;
82
82
}
Original file line number Diff line number Diff line change @@ -62,12 +62,12 @@ public async ValueTask<IPagedList<TProjection>> GetAllByProjectionAsync<TProject
62
62
{
63
63
var query = Collection . AsQueryable ( ) ;
64
64
65
- if ( filter != null )
65
+ if ( filter is not null )
66
66
{
67
67
query = query . Where ( filter ) ;
68
68
}
69
69
70
- if ( orderBy != null )
70
+ if ( orderBy is not null )
71
71
{
72
72
query = descending ? query . OrderByDescending ( orderBy ) : query . OrderBy ( orderBy ) ;
73
73
}
Original file line number Diff line number Diff line change @@ -59,12 +59,12 @@ public async ValueTask<IPagedList<TProjection>> GetAllByProjectionAsync<TProject
59
59
using var session = documentStore . OpenAsyncSession ( ) ;
60
60
61
61
var query = session . Query < TEntity > ( ) ;
62
- if ( filter != null )
62
+ if ( filter is not null )
63
63
{
64
64
query = query . Where ( filter ) ;
65
65
}
66
66
67
- if ( orderBy != null )
67
+ if ( orderBy is not null )
68
68
{
69
69
query = descending
70
70
? query . OrderByDescending ( orderBy )
Original file line number Diff line number Diff line change @@ -62,12 +62,12 @@ public async ValueTask<IPagedList<TProjection>> GetAllByProjectionAsync<TProject
62
62
var blogDbContext = await dbContextFactory . CreateDbContextAsync ( ) ;
63
63
var entity = blogDbContext . Set < TEntity > ( ) . AsNoTracking ( ) . AsQueryable ( ) ;
64
64
65
- if ( filter != null )
65
+ if ( filter is not null )
66
66
{
67
67
entity = entity . Where ( filter ) ;
68
68
}
69
69
70
- if ( orderBy != null )
70
+ if ( orderBy is not null )
71
71
{
72
72
entity = descending
73
73
? entity . OrderByDescending ( orderBy )
@@ -97,7 +97,7 @@ public async ValueTask StoreAsync(TEntity entity)
97
97
public async ValueTask DeleteAsync ( string id )
98
98
{
99
99
var entityToDelete = await GetByIdAsync ( id ) ;
100
- if ( entityToDelete != null )
100
+ if ( entityToDelete is not null )
101
101
{
102
102
var blogDbContext = await dbContextFactory . CreateDbContextAsync ( ) ;
103
103
blogDbContext . Remove ( entityToDelete ) ;
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ OnYesPressed="DeleteItem"></ConfirmDialog>
98
98
99
99
private async Task HandleDrop (ProfileInformationEntry dropTarget )
100
100
{
101
- if (currentDragItem == null || dropTarget == currentDragItem )
101
+ if (currentDragItem is null || dropTarget == currentDragItem )
102
102
{
103
103
return ;
104
104
}
Original file line number Diff line number Diff line change 83
83
84
84
private async Task HandleDrop (ProficiencyLevel proficiencyLevel )
85
85
{
86
- if (currentDragItem == null || currentDragItem .ProficiencyLevel == proficiencyLevel )
86
+ if (currentDragItem is null || currentDragItem .ProficiencyLevel == proficiencyLevel )
87
87
{
88
88
return ;
89
89
}
Original file line number Diff line number Diff line change 65
65
<label for =" tags" >Tags</label >
66
66
<InputText class =" form-control" id =" tags" @bind-Value =" model.Tags" />
67
67
</div >
68
- @if (BlogPost != null && ! IsScheduled )
68
+ @if (BlogPost is not null && ! IsScheduled )
69
69
{
70
70
<div class =" form-check" >
71
71
<InputCheckbox class =" form-check-input" id =" updatedate" @bind-Value =" model.ShouldUpdateDate" />
117
117
118
118
protected override void OnParametersSet ()
119
119
{
120
- if (BlogPost == null )
120
+ if (BlogPost is null )
121
121
{
122
122
return ;
123
123
}
Original file line number Diff line number Diff line change 6
6
@inject IRepository <BlogPost > BlogPostRepository
7
7
@inject IToastService ToastService
8
8
9
- @if (blogPostFromDb != null )
9
+ @if (blogPostFromDb is not null )
10
10
{
11
11
<CreateNewBlogPost
12
12
Title =" Update BlogPost"
38
38
await BlogPostRepository .StoreAsync (blogPostFromDb );
39
39
ToastService .ShowInfo ($" Updated BlogPost {blogPost .Title }" );
40
40
}
41
- }
41
+ }
Original file line number Diff line number Diff line change 16
16
<div class =" card-body" >
17
17
<div class =" row" >
18
18
<DateRangeSelector FilterChanged =" RefreshVisitCount" ></DateRangeSelector >
19
- @if (visitData != null )
19
+ @if (visitData is not null )
20
20
{
21
21
<p id =" total-clicks" >@visitData.Sum(c => c .ClickCount ) clicks in total </p >
22
22
}
31
31
<th >Clicks</th >
32
32
<th >Likes</th >
33
33
</tr >
34
- @if (visitData != null )
34
+ @if (visitData is not null )
35
35
{
36
36
@foreach ( var date in visitData )
37
37
{
Original file line number Diff line number Diff line change 14
14
{
15
15
<Loading ></Loading >
16
16
}
17
- @if (sitemapUrlSet != null )
17
+ @if (sitemapUrlSet is not null )
18
18
{
19
19
<table class =" table table-striped table-hover h-50" >
20
20
<thead >
You can’t perform that action at this time.
0 commit comments