File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
aspnet-core/src/AbpCompanyName.AbpProjectName.Application/Users Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 6
6
using Abp . Application . Services ;
7
7
using Abp . Application . Services . Dto ;
8
8
using Abp . Authorization ;
9
+ using Abp . Domain . Entities ;
9
10
using Abp . Domain . Repositories ;
10
11
using Abp . IdentityFramework ;
11
12
using Abp . Localization ;
@@ -129,7 +130,14 @@ protected override IQueryable<User> CreateFilteredQuery(PagedResultRequestDto in
129
130
130
131
protected override async Task < User > GetEntityByIdAsync ( long id )
131
132
{
132
- return await Repository . GetAllIncluding ( x => x . Roles ) . FirstOrDefaultAsync ( x => x . Id == id ) ;
133
+ var user = await Repository . GetAllIncluding ( x => x . Roles ) . FirstOrDefaultAsync ( x => x . Id == id ) ;
134
+
135
+ if ( user == null )
136
+ {
137
+ throw new EntityNotFoundException ( typeof ( User ) , id ) ;
138
+ }
139
+
140
+ return user ;
133
141
}
134
142
135
143
protected override IQueryable < User > ApplySorting ( IQueryable < User > query , PagedResultRequestDto input )
You can’t perform that action at this time.
0 commit comments