[Проблема] Падает при чтении большого блоба
От: Holms США  
Дата: 10.12.10 05:34
Оценка:
такой LINQ

public byte[] GetContent(int templateId)
{
    Binary b = Context.ProjectTemplate
        .Where(_ => _.Id == templateId)
        .Select(_ => _.Content)
        .FirstOrDefault();

    return b == null ? null : b.ToArray();
}


падает с ошибкой Out of memory когда имеем блоб размера 75Мб.

В то вермя как такой код
public byte[] GetContentPureSql(int templateId)
{
    var ctx = Context;
    return
        ctx
            .SetCommand("select Content from ProjectTemplate where Id = @Id",
                                    ctx.InputParameter("@Id", templateId))
            .ExecuteScalar<byte[]>();
}


работает отлично.

Просьба починить первый.

Спасибо
... << RSDN@Home 1.2.0 alpha 4 rev. 1476>>
The life is relative and reversible.
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.