internal static TEntity GetSafely <TEntity, TKey>(this Row <TKey, byte[]> returnedRow) { if (returnedRow.Exists) { return((TEntity)ObjectHelper.ByteArrayToObject(returnedRow.Value)); } return(default(TEntity)); }
internal static IQueryable <TEntity> AsQueryable <TKey, TEntity>(this IEnumerable <Row <TKey, TEntity> > rows) { ICollection <TEntity> values = new List <TEntity>(); foreach (Row <TKey, TEntity> row in rows) { values.Add((TEntity)ObjectHelper.ByteArrayToObject(row.GetValuePart(0))); } return(values.AsQueryable()); }