Add Sql method to DbRepository and EFCore.Relational refs
Added a Sql method to DbRepository for executing raw SQL queries via FromSqlRaw. Included Microsoft.EntityFrameworkCore.Relational package references for all target frameworks to support this functionality. Cleaned up unused using directives.
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
using AutoMapper;
|
||||
using DigitalData.Core.Abstraction.Application.Repository;
|
||||
using DigitalData.Core.Abstractions.Interfaces;
|
||||
using DigitalData.Core.Infrastructure.Factory;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Linq.Expressions;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
using Microsoft.EntityFrameworkCore.Query;
|
||||
#if NETFRAMEWORK
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
@@ -44,6 +42,11 @@ namespace DigitalData.Core.Infrastructure
|
||||
Mapper = mapper;
|
||||
}
|
||||
|
||||
public IQueryable<TEntity> Sql([NotParameterized] string sql, params object[] parameters)
|
||||
{
|
||||
return Entities.FromSqlRaw(sql, parameters);
|
||||
}
|
||||
|
||||
#region Create
|
||||
public virtual async Task<TEntity> CreateAsync(TEntity entity, CancellationToken cancel = default)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user