EF6 OutOfMemoryException Evaluating Entity with varbinary(max) Property

entity-framework entity-framework-6 one-to-many varbinarymax

Accepted Answer

Because the DTOs were accessing EF attributes (highlighted below), which led to out of memory issues with bigger data sets, @IvanStoev helped us identify the issue.

public class BatchChargeDTO
{
    public int ID { get; set; }
    public byte[] FileData { get; set; }
    // Problem is here: type should be ChargeDTO!!
    public ICollection<Charge> Charges { get; set; }
}

public class ChargeDTO
{
    public int ID { get; set; }
    public DateTime CreatedUTC { get; set; }
    public decimal Amount { get; set; }
    public int? BatchChargeID { get; set; }
    // Problem is here: type should be BatchChargeDTO!!
    public BatchCharge BatchCharge { get; set; }
}
3
7/2/2018 10:55:11 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow