public static List <T> FromSql <T>( this IItsDbContext dataContext, string sql, params object[] parameters) where T : class { return(dataContext.Set <T>().FromSql(sql, parameters).ToList()); }
internal static Task <List <T> > FromSqlAsync <T>( this IItsDbContext dataContext, CancellationToken ctok, string sql, params object[] parameters) where T : class { return(dataContext.Set <T>().FromSql(sql, parameters).ToListAsync(ctok)); }
public static bool RemoveEntry <T>(this IItsDbContext dataContext, T exist) where T : class { try { dataContext.Set <T>().Remove(exist); return(true); } catch (Exception) { return(false); } }
public static bool AddEntry <T>(this IItsDbContext dataContext, T entity) where T : class { try { dataContext.Set <T>().Add(entity); return(true); } catch (Exception) { return(false); } }