Add QueryRaw and QueryInterpolated methods to repository

Added `QueryRaw` and `QueryInterpolated` methods to the
`IRepository` interface for raw and interpolated SQL queries,
conditionally compiled for the `NET` target framework.

Removed the `Sql` method from `DbRepository` and replaced it
with implementations of `QueryRaw` and `QueryInterpolated`
using `Entities.FromSqlRaw` and `Entities.FromSqlInterpolated`.

Updated the `Query` property in `DbRepository` to use
`Entities.AsNoTracking()` for read-only queries.
This commit is contained in:
Developer 02
2025-12-19 09:05:59 +01:00
parent ce5c59dfc2
commit 82686db38b
2 changed files with 14 additions and 5 deletions

View File

@@ -63,6 +63,16 @@ namespace DigitalData.Core.Abstraction.Application.Repository
#endif
IQueryable<TEntity> Query { get; }
#if NET
public
#endif
IQueryable<TEntity> QueryRaw([NotParameterized] string sql, params object[] parameters);
#if NET
public
#endif
IQueryable<TEntity> QueryInterpolated([NotParameterized] FormattableString sql);
#if NET
public
#endif