Abp: QueryApplicationService for readonly services.

Created on 25 Feb 2020  路  3Comments  路  Source: abpframework/abp

HI! First of all great job! I'm starting with this framework and seems really cool.

I have a question, I have an application service, this service is used to create an "Aggregate Root" with custom code. To do that I created a method to create the data in the database.

To show the data I want to take advantage of all implemented stuff in the CrudAppService but seems to be a lot of functionality without really needed.

So that I see two options, inherited from CrudAppService and ignore the not needed stuff or create a new base AppService, something like QueryAppService and duplicated the needed code from CrudAppService.

My questions are, is there another option? Could it be an interesting change split the CrudAppService into two base services?

Most helpful comment

If you don't need CRUD, I suggest you create your application service manually. And add methods as needed.

All 3 comments

If you don't need CRUD, I suggest you create your application service manually. And add methods as needed.

Like @maliming said, you can create a service implements ApplicationService. Or you can continue to implement CrudAppService, and just disable unwanted methods, for example:

        [RemoteService(IsMetadataEnabled = false)]
        public override Task<OrderDto> CreateAsync(CreateOrderDto input)
        {
            throw new NotImplementedException();
        }

For future references: Solved in #4346

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hikalkan picture hikalkan  路  3Comments

Trojaner picture Trojaner  路  3Comments

hikalkan picture hikalkan  路  3Comments

hikalkan picture hikalkan  路  3Comments

ugurozturk picture ugurozturk  路  3Comments