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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user