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 66using Abp . Application . Services ;
77using Abp . Application . Services . Dto ;
88using Abp . Authorization ;
9+ using Abp . Domain . Entities ;
910using Abp . Domain . Repositories ;
1011using Abp . IdentityFramework ;
1112using Abp . Localization ;
@@ -129,7 +130,14 @@ protected override IQueryable<User> CreateFilteredQuery(PagedResultRequestDto in
129130
130131 protected override async Task < User > GetEntityByIdAsync ( long id )
131132 {
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 ;
133141 }
134142
135143 protected override IQueryable < User > ApplySorting ( IQueryable < User > query , PagedResultRequestDto input )
You can’t perform that action at this time.
0 commit comments