3
I am working on a project using EF6 with C#, in one of my classes I have to save a file, example below:
public partial class Arquivo
{
[Key]
public int ArquivoID { get; set; }
public string Nome { get; set; }
public byte[] ArquivoFisico { get; set; }
public string TipoArquivo { get; set; }
}
my problem is in the property arquivofisico
when I consult data from other classes that are linked to this would not like it to load the property arquivofisico
, because I can have files of 5, 10 MB, the memory of my server will burst if there are many classes... I want to access this property only when using a Handler generic to download.
Have any hints to do this or I have to use Lazy loading same?
Thanks for the Help.
Thank you for the answer! Interesting, but I forgot to mention that I am using a generic repository to search the data there I believe that the thing changes a bit of figure... I use the get method as below: Iqueryable<Tentity> Get(Func<Tentity, bool> predicate);
– Alex Becker
Get rid of your generic repository. It is useless. See more here.
– Leonel Sanches da Silva