简体   繁体   English

在wpf中使用dbcontext

[英]using dbcontext in wpf

I am developing a wpf desktop app using vs2013. 我正在使用vs2013开发一个wpf桌面应用程序。 And I am using sqlite as database. 我正在使用sqlite作为数据库。 To perform operations on database, I am using dbcontext class. 为了对数据库执行操作,我正在使用dbcontext类。 Now using this procedure, I have the whole database object in my class and on this object I perform operations( I hope my understanding is corect). 现在使用此过程,我在类中拥有整个数据库对象,并在该对象上执行操作(希望我的理解是corect)。 After performing operation, I garbage collect that object. 执行完操作后,我会垃圾收集该对象。 Now what if my db size grows to 1gb. 现在,如果我的数据库大小增加到1GB,该怎么办。 Is it a good idea to use this procedure? 使用此过程是一个好主意吗? If not what are the other alyernatives? 如果不是,其他的替代品是什么?

Entity Framework does not load the entire database into memory. 实体框架不会将整个数据库加载到内存中。 The DbContext performs SQL queries when you use it, so you shouldn't have problems with a growing database. 使用DbContext时,它会执行SQL查询,因此,随着数据库的增长,它不会出现问题。 I don't know about the performance of huge SQLite databases, though. 我不知道大型SQLite数据库的性能。 Take a look at this question for some perspective on that. 这个角度看一下这个问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM