How can I use Union All
on different entities using Ardalis CleanArchiteture ?
Example is if I have Product
and ProductKit
, they have different structures and are different entity.
Is there a way to use Ardalis Repository Specification and union all
Product (Id, Name)
and ProductKit (Id, Name)
?
The main goal is to search by Name
and return only Id
and Name
from Entities (maybe just a flag isKit
to identifiable in results) using Paged results.
I am using
<PackageReference Include="Ardalis.Specification.EntityFrameworkCore" Version="6.0.1" />
Ardalis.Specification is a library designed to help create and compose query specifications in Entity Framework Core. It doesn't natively support the UNION ALL operation, as it primarily focuses on building expressive and reusable query specifications.
If you want to perform a UNION ALL operation using Ardalis.Specification, you might need to handle that part outside of the specification itself. You could follow these general steps: