2017-08-11 10 views

答えて

1

[RemoteService]属性を使用して、アプリケーションサービスの動的Web APIの作成を無効にすることができます。また、この属性はアプリケーションサービスのメソッドにも使用できます。

[RemoteService(false)] 
public interface IRoleAppService : IAsyncCrudAppService<RoleDto, int, PagedResultRequestDto, CreateRoleDto, RoleDto> 
{ 
     Task<ListResultDto<PermissionDto>> GetAllPermissions(); 
} 

https://aspnetboilerplate.com/Pages/Documents/Dynamic-Web-API#enabledisable


[RemoteService]は、それを無効にする最も簡単な方法ですが、あなたは、高度なアクションのために以下のコードを使用することができます。

Configuration.Modules.AbpWebApi().DynamicApiControllerBuilder 
    .ForAll<IApplicationService>(Assembly.GetExecutingAssembly(), "app") 
    .ForMethods(builder => 
    { 
     if (builder.Method.IsDefined(typeof(MyIgnoreApiAttribute))) 
     { 
      builder.DontCreate = true; 
     } 
    }) 
    .Build(); 
+0

ありがとうございました! –

関連する問題