You can use ODBC as a basic and free solution to connect .NET 8 to DB2 on IBM i, but it can be limited in terms of performance and flexibility.
For a more advanced option, take a look at NTi Data Provider from Aumerial. It's a new solution, natively built for .NET, requiring no additional drivers or middleware. It provides seamless access to both DB2 data and IBM i programs (CL commands, stored procedures, etc.), with support for EF CORE for DB2 for i.
More details here: https://www.aumerial.com.