EasyAbp / AbpHelper.CLI

Providing code generation and more features to help you develop applications and modules with the ABP framework.
MIT License
284 stars 94 forks source link

Use MenuConfigurationContext's GetLocalizer method and IsGrantedAsync method #67

Closed gdlcf88 closed 4 years ago

gdlcf88 commented 4 years ago

Use var l = context.GetLocalizer<MyProjectNameResource>(); to replace var l = context.ServiceProvider.GetRequiredService<IStringLocalizer<MyProjectNameResource>>();

Remove var authorizationService = context.ServiceProvider.GetRequiredService<IAuthorizationService>(); and use if (await context.IsGrantedAsync(xxx)) to replace if (await authorizationService.IsGrantedAsync(xxx))

See: https://github.com/abpframework/abp/pull/4084/files#diff-60c6161a5603c35f37e13d7368797f30