title: Unable to use .SqlQuery method when porting from .NET Framework to .NET Standard 2.0
body: <p>I'm currently porting over my project from the .NET Framework to .NET Standard 2.0, and will be feeding the nuget packages to a .NET Core application. With that said I'm currently having issues on handling this last issue which is that i'm unable to use the SqlQuery method using the .NET Standard framework. Below is the error i'm receiving as well as the libraries being used and where I was originally using the SqlQuery method. I have seen various implementations with FromSql however I don't believe this works for me because I want to return an <strong>int</strong> and FromSql returns <strong>TEntity</strong>.</p>
  
  <hr>
  
  <blockquote>
    <p>'DatabaseFacade' does not contain a definition for 'SqlQuery' and no
    accessible extension method 'SqlQuery' accepting a first argument of
    type 'DatabaseFacade' could be found (are you missing a using
    directive or an assembly reference?)</p>
  </blockquote>
  
  <hr>
  
  <pre><code>using Microservices.LibCore.Core;
  using Microservices.LibCore.Core.Base.Models;
  using Microsoft.EntityFrameworkCore;
  using Newtonsoft.Json;
  using NLog;
  using System;
  using System.Collections.Generic;
  using System.ComponentModel.DataAnnotations;
  using System.ComponentModel.DataAnnotations.Schema;
  using System.Data.SqlClient;
  using System.Linq;
  using System.Net;
  using System.Reflection;
  </code></pre>
  
  <hr>
  
  <pre><code>public static List&lt;object&gt; setLegacyKey(DbContext dbContext, ServiceObject obj)
          {
              var keyValuesFound = new List&lt;object&gt;();
              var keyProperties = getKeyProperties(obj);
  
              foreach (var key in keyProperties)
              {
                  string sql = "select " + getKeyColumnName(key) + " from " + getTableName(obj) + " where global_id=@p0";
  
                  List&lt;object&gt; result = dbContext.Database.SqlQuery(key.PropertyType, sql, obj.Id).ToListAsync().Result;
  
                  if (result.Count == 0)
                  {
                      throw new ServiceException(ServiceError.ERROR_CODE.INVALID_REQUEST, String.Format("Invalid {1}.ID ({0})", obj.Id, obj.GetType().Name));
                  }
  
                  var keyValue = result.FirstOrDefault();
  
                  key.SetValue(obj, keyValue);
  
                  keyValuesFound.Add(keyValue);
              }
  
              return keyValuesFound;
          }
  </code></pre>