Skip to content

Query: Translate byteArray.Length on SQL Server and SQLite to avoid reading complete blobs #13487

@KLuuKer

Description

@KLuuKer

when querying the length of a byte[] sql like this is produced

actual:
SELECT [Blob] From [MyTable]
expected:
SELECT DATALENGTH([Blob]) as [HowLong] From [MyTable]

Steps to reproduce

class MyTable {
 public byte[] Blob { get; set; }
}

ctx.MyTables.Select(x => new { HowLong = x.Blob.Length }).ToList()

Further technical details

EF Core version: 2.2.0-preview2-35157
Database Provider: Microsoft.EntityFrameworkCore.SqlServer
Operating system: Windows 10
IDE: Visual Studio 2017 15.9.0 Preview 3

Metadata

Metadata

Assignees

No fields configured for Feature.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions