abp icon indicating copy to clipboard operation
abp copied to clipboard

Overriding AppService mantains both services

Open luisp88 opened this issue 6 years ago • 5 comments

I need to add a profilePicture database field for my AbpUsers, so I extended IdentityUserAppService and changed the return with new Dto (this dto extends from IdentityUserDto, so dont need to change the inerface signatures). image Al worked fine, the problem is that I see "old" and "new" identityappservice, and both goes to the same method and return the Dto with the profile picture (that is ok) Custom: image Original: image

Is there a easier way to achieve that? Thanks in advance

luisp88 avatar Mar 12 '20 22:03 luisp88

Did the same with AbpApplicationConfigurationAppService to insert an AppVersion value in ApplicationConfigurationDto and also, two endpoints in swagger MyAbpApplicationConfiguration and AbpApplicationConfiguration

luisp88 avatar Mar 12 '20 22:03 luisp88

https://github.com/abpframework/abp/blob/dev/docs/en/Customizing-Application-Modules-Overriding-Services.md

[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(IIdentityUserAppService))]
public class MyIdentityUserAppService : IdentityUserAppService

see https://docs.abp.io/en/abp/latest/Dependency-Injection#exposeservices-attribute

maliming avatar Mar 13 '20 00:03 maliming

Hi, I already did this and still duplicated on swagger... Also tried the .Replace in configureServices of MyProjectApplicationModule without success. Both GetList methods goes into my custom MyIdentityUserAppService, but there are two endpoints in swagger as the image shows. Something else I am missing?

luisp88 avatar Mar 13 '20 10:03 luisp88

@luisp88 Can you use cli to create a project that reproduces the problem?

maliming avatar Mar 13 '20 12:03 maliming

@maliming I just saw your recently answer in another post yesterday (#3123) that has the exact same problem than me This solves [ExposeServices(typeof(IAbpApplicationConfigurationAppService), typeof(AbpApplicationConfigurationAppService))] [RemoteService(IsEnabled = false)] public class MyAbpApplicationConfigurationAppService : AbpApplicationConfigurationAppService, IAbpApplicationConfigurationAppService Thanks.

luisp88 avatar Mar 16 '20 16:03 luisp88