idbset sqlquery
using System;
using System.Collections.Generic;
using System.Data.Entity;
namespace DAL.Models
{
public static class IDbSetExtensions
{
/// <summary>
/// When using IDbSet Interface the SQLQuery method is hidden this extension method will allow us to expose the method
/// </summary>
/// <typeparam name="TEntity">Entity Class</typeparam>
/// <param name="set">IDbSet</param>
/// <param name="query">String sql query</param>
/// <returns></returns>
public static IEnumerable<TEntity> SearchQuery<TEntity>(this IDbSet<TEntity> set, string query)
where TEntity : class
{
var dbSet = set as DbSet<TEntity>;
if (dbSet != null)
{
return dbSet.SqlQuery(query);
}
throw new NotSupportedException();
}
}
}
Also in C#:
- how to reference scripts in other scenes unity
- how to parse a string to an integer c#
- c# write to console
- c# silent execute exe
- count the number of notes in a given amount c#
- JavaScriptSerializer() and convert to base64
- for each textbox c#
- c# lambda expression
- set width of rect transform unity
- c# read char
- unity accessing 2d pointlight from c# script
- how to route back to url using Request.Headers["Referer"].ToString() in asp.net core
- how to reduce garbage collection c#
- split using string c#
- system.io.directorynotfoundexception c#
- c# graphics draw filled rectangle
- c# only letters
- how to start grid from where the data starts in c# charts
- c# user input
- c# public static string
- how to copy one array value to another without reference c#
- unity3d raycast
- bitmap to byte array c#