LightSwitch的速度很慢,ADO.NET实体框架/域名服务/ WCF RIA服务 [英] Lightswitch is slow, ADO.NET Entity Framework/Domain Service/WCF RIA Service

查看:217
本文介绍了LightSwitch的速度很慢,ADO.NET实体框架/域名服务/ WCF RIA服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发在VS2012的Lighswitch应用程序与外部SQL Server 2008中我使用WCF RIA服务来获取我的数据,使用这些技巧:<一href="http://www.c-sharpcorner.com/UploadFile/raj1979/how-to-use-wcf-ria-service-in-lightswitch-2012/" rel="nofollow">http://www.c-sharpcorner.com/UploadFile/raj1979/how-to-use-wcf-ria-service-in-lightswitch-2012/.

I'm developing an Lighswitch application in VS2012 with an external SQL Server 2008. I'm using a WCF RIA Service to fetch my data, using these techniques: http://www.c-sharpcorner.com/UploadFile/raj1979/how-to-use-wcf-ria-service-in-lightswitch-2012/.

我的主表中包含静态数据和外键约5列的一些列。静态数据列载瞬间,但所有的外特性需要3-5秒,用来加载〜100行的屏幕上。这是不能接受的。

My main table contains some columns with static data and about 5 columns with foreign keys. The static data columns loads instant but all the foreign properties takes 3-5 secs to load on a screen with ~100 rows. This is not acceptable..

我的问题是,我不知道在哪里可能的瓶颈。任何想法,我可以开始寻找?我能想到的,到目前为止的唯一的事情是,我的ADO.NET模型使用延迟加载,而且它。

The problem for me is that I don't know where the bottleneck might be. Any ideas where I could start looking? The only thing I could think of so far is that my ADO.NET model uses Lazy Loading, and it does.

所有的外键的属性只有两列用PK和一些文字,所以他们没有数据沉重。

All the foreign key properties only has two columns with a PK and some text, so they're not data heavy.

任何帮助AP preciated,谢谢!

Any help appreciated, thanks!

推荐答案

我不知道这是否是你的速度问题的确切答案,但你引用的那篇文章建议您添加 ADO.NET数据模型的包含该类库的 RIA服务的。

I don't know if this is the exact answer to your speed problem, but that article you quoted suggests that you add a new ADO.NET Data Model to the class library containing the RIA Service.

但绝对没有理由产生的第二数据模型,为LightSwitch的生成一个当您将外部数据源(SQL Server数据库)。您不妨再使用它。一个EF数据模型需要时间来建立,所以我想使用两个EF数据模型可以解释您所遇到的缓慢,但它也有可能是别的东西完全。

There's absolutely no reason to generate a second data model, as LightSwitch already generates one when you attach the external data source (your SQL Server database). You may as well re-use it. An EF data model takes time to construct, so I suppose that using two EF data models could explain the slowness you're experiencing, but it could also be something else entirely.

有一个看看这篇文章(原RIA服务/ LightSwitch的文章,和放大器,仍然是最好的),其中除其他一些技术,埃里克将告诉你如何重​​新使用LightSwitch中创建您的数据源中的数据模型

Have a look at this article (the original RIA Service/LightSwitch article, & still the best), which among several other techniques, Eric will show you how to re-use the data model that LightSwitch creates for your data source.

<一个href="http://blogs.msdn.com/b/lightswitch/archive/2011/04/08/how-do-i-display-a-chart-built-on-aggregated-data-eric-erhardt.aspx"相对=nofollow>如何:显示建在一个图表汇总数据

在本文中,RIA服务创建专门的汇总的数据在图表中显示,但你可以做任何你需要做的吧。它不具有聚集的数据。我用RIA服务与连接的数据源(SQL数据库)广泛,提供清单,报告,以及查找数据的数据组合框。

In this article, the RIA service is created to specifically aggregate data to display in a chart, but you can do whatever you need to do in it. It doesn't have to aggregate data. I use RIA services with an attached data source (a SQL database) extensively, to provide data for lists, reports, as well as lookup data for combo boxes.

这篇关于LightSwitch的速度很慢,ADO.NET实体框架/域名服务/ WCF RIA服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆