lazy-loading

Scaffold-DbContext not generating virtual navigation properties (EF Core 2.1)

不打扰是莪最后的温柔 提交于 2019-12-24 00:05:29
问题 I am using EF Core 2.1 database-first. I use Scaffold-DbContext to create/update my models (the .cs files) I want to enable lazy-loading, and I have added .UseLazyLoadingProxies() in my Startup.cs Now, how do I get Scaffold-DbContext to generate virtual navigation properties? 来源: https://stackoverflow.com/questions/50827976/scaffold-dbcontext-not-generating-virtual-navigation-properties-ef-core-2-1

How to lazily create tasks for use by a Java thread-pool

独自空忆成欢 提交于 2019-12-23 22:27:21
问题 I'm writing a load-testing application in Java, and have a thread pool that executes tasks against the server under test. So to make 1000 jobs and run them in 5 threads I do something like this: ExecutorService pool = Executors.newFixedThreadPool(5); List<Runnable> jobs = makeJobs(1000); for(Runnable job : jobs){ pool.execute(job); } However I don't think this approach will scale very well, because I have to make all the 'job' objects ahead of time and have them sitting in memory until they

Entity Framework, SQLite and Lazy loading

断了今生、忘了曾经 提交于 2019-12-23 21:09:58
问题 Hi I had developed a C# Budget application using SQL Compact and EF4, I created the EF model through the VS2010 Entity Data Model template. It is all working very well. However I am considering developing a iPhone app to support cash transactions and thought it would be better to have the back end DB supported on both platforms. After creating the SQLite DB and creating a new model I have come across a problem when trying to access referenced data via the Navigation properties in my model. I

Code on scroll event is not executing if window is zoomed in/out in chrome

北慕城南 提交于 2019-12-23 15:52:33
问题 I'm using below script to load data on scroll reaches bottom of the page and its working fine in all browsers. But it doesn't seems working in chrome if i manually zoom in / zoom out window using keyboard shortcuts Ctr+ or Ctrl- (> or < default zoom ). if (($(window).scrollTop() + $(window).innerHeight()) >= $(document).height()){ loadData(); } 回答1: This seems to be a bug in chrome and i have reported this here>> Even, i made it working by applying a small height reduction (-100) to satisfy

MySQL + Code First + Lazy Load problem !

别等时光非礼了梦想. 提交于 2019-12-23 15:15:19
问题 in a very simple real estate program I'm trying to list all images for a house using EF Code First attached to an existing DB I have, I'm using MySQL Conector 6.3.6, here's my code. namespace CodeFirstMySQL { class Program { static void Main(string[] args) { RealEstate db = new RealEstate(); var houses = (from h in db.Houses select h).Take(10); foreach (var house in houses) { Console.WriteLine(string.Format("Images for {0}", house.Address)); foreach (Image image in house.Images) { Console

In EF4 Code first Collection are not lazy loading?

为君一笑 提交于 2019-12-23 15:14:08
问题 Using Microsoft Visual C# 2010 Express, Entity Framework Feature CTP4. I tried EF4 with code first with something small based on Scott Gu's blog. But it seems that collections are not initialized when retrieving an entity. I get a null reference exception when adding a product to a category. In all the examples I've seen, the collection are never explicitly initialized. What am I missing? Here's my code: using System; using System.Collections.Generic; using System.Linq; using System.Text;

MEF CachedAssemblyCatalog - Lazy Loading of Assemblies

扶醉桌前 提交于 2019-12-23 13:13:42
问题 I'm very interested in the CachedAssemblyCatalog class introduced in the samples provided in older versions of MEF - which allows loading a small assembly containing just the export data instead of the entire assembly, and only loading the full assembly when a part from that assembly is required. I'd like to use this feature in my application, but I'm not really sure about the stability/reliability of this code, and whether there are any future plans regarding this feature. Is it scheduled to

How to use lazy loading in Spring MVC

馋奶兔 提交于 2019-12-23 12:05:47
问题 How to use lazy loading in Spring MVC? I'm using eager at this moment, but this makes my app works slowler. This is part of my domain: @ManyToMany(fetch = FetchType.EAGER) @JoinTable(name = "NEWS_TAG", joinColumns = @JoinColumn(name = "NEWS_ID"), inverseJoinColumns = @JoinColumn(name = "TAG_ID")) private List<Tags> tags = new ArrayList<Tags>(); public List<Tags> getTags() { return this.tags; } And dao: public List<News> getSomeNews(long b, long hm) { List<News> news = (List<News>)

Static constructors in F# - when do they run?

和自甴很熟 提交于 2019-12-23 09:54:48
问题 I am experimenting with various ways of creating singletons in F#, so that I understand the subtleties better. I don't know if the singleton pattern is ever useful in F#, but I wanted to experiment. And I was surprised by one result involving static constructors on those singleton instances. First I'll show you my code, and then I'll go into more details about my question. In one project called TrySingleton , I created three modules. Here's Eager.fs : module TrySingleton.Eager type EagerClass

Multiple containers in Lazy Load

て烟熏妆下的殇ゞ 提交于 2019-12-23 09:39:26
问题 I am trying to apply Lazy Load plugin to multiple containers. I found this similar question: Lazy Load on MULTIPLE horizontal containers. this is my attempt: http://jsfiddle.net/BAFMC/ $(".p_outer_content").each(function() { var tthis = $(this); $(this).find('img').lazyload({ container: tthis }); });​ But I have the same problem as the question mentioned, which is that Lazy load only applies to the last container (.p_outer_content) (which is the third one in the fiddle). Does anyone know how