示例#1
0
 /// <summary>
 /// 执行sql
 /// 使用方式 FormattableString sql=$"select * from xx where name ={xx} and pwd={xx1} ",
 /// FromSqlInterpolated内部处理sql注入的问题,直接在{xx}写对应的值即可
 /// 注意:sql必须 select * 返回所有TEntity字段,
 /// </summary>
 /// <param name="formattableString"></param>
 /// <returns></returns>
 public virtual IQueryable <TEntity> FromSqlInterpolated([NotNull] FormattableString sql)
 {
     //DBSet.FromSqlInterpolated(sql).Select(x => new { x,xxx}).ToList();
     return(DBSet.FromSqlInterpolated(sql));
 }