问题标签 [subsonic]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
.net - 基于 ORM 的项目中的类使用
这个问题是关于 NHibernate、Subsonic、Linq2SQL 等 ORM 项目中的“最佳使用”场景......
所有这些工具都生成基本的实体类,有些带有属性,有些没有。人们是否将这些课程用作他们的业务课程?或者是否将数据从 ORM 生成的类批量复制到手动创建的业务类?
谢谢。
subsonic - 由于缺少依赖项,SubSonic“版本”失败
我正在使用 SubSonic 2.1 Final 但在使用 SubCommander 运行“版本”时遇到问题。我认为当我在本地计算机上安装 SQL Server 2008 并删除 2005 时,这个问题就开始了。
这是我得到的错误:
任何人都知道如何使这项工作?
variables - 带有捕获变量的 Lambda
考虑以下代码行:
因此,当我将一个实际数字硬连接到 lambda 函数中时,它可以正常工作。当我在表达式中使用捕获的变量时,它会返回以下错误:
不存在从对象类型 ReportBuilder.Reporter+<>c__DisplayClass0 到已知托管提供程序本机类型的映射。
为什么?我该如何解决?
subsonic - 如何获得更多从亚音速查询我的数据源的方法
在下面的链接中,Linq-To-Sql 生成了一系列方法来根据各种实际需求(例如最近的主题等)获取数据。
如何让 Subsonic 为我生成一组类,这些类将以这种方式从我的数据源中查询并返回数据?我得到的课程实际上只是呈现 CRUD 操作。
谢谢
subsonic - Inserting a new record pattern in SubSonic 3
I'm trying out the new SubSonic 3 preview, but I'm not sure about the patterns I should be using for the basic CRUD operations in my MVC project.
I'm trying to keep as much of my data logic in my models, so I added some static CRUD methods to each model's partial class.
For example, let's say I have a configuration table, which should only have a single record. So, my partial class may look something like this:
Currently, this doesn't work as the config table has an identity column for a primary key, and Add-ing a new record to the table throws the standard "Cannot insert explicit value for identity column" error. SubSonic 3 doesn't seem to generate classes that, upon new-ing them up, play nice with the rules of the database schema (i.e., no default values, no nullable primitives for values that are nullable in the database, etc).
Now, I can alter my table and pattern to get around these issues, but I'm wondering about when I cannot get around this issue--when I have to add a new record to the database and have an identity as my primary key.
I'm also wondering if this pattern is even correct or not. SubSonic gives you a number of different ways you can go about your repository business, so I'm not sure which one I should be using. I'd LIKE to use my models as MUCH as possible (otherwise why not just Linq to Sql?), so I don't want to use SubSonic's query building goodness when trying to CRUD my models.
What should I do here? Any advice on CRUD patterns for using SubSonic 3 in my MVC project would be welcome and +'d. Also welcome are links to websites that cover this subject for SubSonic 3 but that don't rank high in Google searches...
Asked Rob directly (link here). For my DB, at least, there's a showstopper bug in the generated code. Aaah, alpha software.
UPDATE
With the release of Subsonic3, can we have a little bump to reconsider this question?
subsonic - .netTiers 与 SubSonic
今天下午我有一些时间来比较 netTiers 和 SubSonic。
我使用了使用 SubStage(SubSonic 2.1 版本的一部分)生成的代码,并使用 RepositoryRecord 作为我的基类。
我使用 .netTiers 2.2 生成的代码对同一个数据库进行了相同的测试
该测试是 Rob Conery 在他的帖子中使用的测试的衍生产品:
http://blog.wekeroad.com/blog/subsonic-scaling/
当我说导数时,我的意思是我刚刚将 100,000 条记录写入数据库。
我在同一台 PC 上重复了每个测试三遍。
我发现 .netTiers 在 90 秒内完成了任务。
亚音速在 104 秒内完成。
与这些平均值的偏差不超过一秒。
subsonic - 自动更新 SubSonic 中的 AdditionalBy 和 EditedBy 字段
我有一个数据模型,其中包括常见的列,如 addedBy、editby(用户)、addDate、editedDate。
是否有我可以在 SubSonic 2.1 中使用的设置来适当地自动更新这些字段,而不必在每次更新中明确指定?
asp.net - 如何避免 SubSonic 的 n+1 问题?
Ayende 有一篇博文详细介绍了如何解决 nHibernate 中的“n+1”问题。本质上,问题是这样的:
假设您有两个表,“BlogPosts”和“Comments”,它们之间存在一对多关系(即每个 BlogPost 可以有多个 Comments)。现在,假设您要执行以下嵌套 for 循环:
据我了解,默认情况下,SubSonic 生成的类是延迟加载的(我不想完全关闭它,因为它在大多数情况下都很有用,而不是这个)。这意味着每次执行内部循环时(即访问 post.Comments 时),必须向数据库发送单独的查询以检索评论。
因此,如果您有 80 篇博文,则需要 1 次查询来获取博文列表,然后是 80 次查询来获取每篇博文的评论。但是,如果评论是预先加载的,则这将减少为 1 个查询。
目前有什么方法可以解决 SubSonic 中的这个问题吗?
asp.net - 将 FreeText 与 SubSonic 一起使用
关于如何将 SQL 2005 的全文搜索与 SubSonic 一起使用,是否存在普遍共识?我知道我可以使用 InlineQuery 并获得 IDataReader,但这是唯一的方法吗?另外,我如何将分页合并到其中?我必须自己在 InlineQuery 中编写分页吗?
我真正想做的是这样的:
这样,我可以使用内置的 Subsonic 分页功能,而不必用 SQL 编写整个查询
subsonic - 为什么 BuildProvider 只能用于 ASP.NET 网站项目?
我打算尝试Subsonic,您可以在 ASP.NET 网站项目中使用 buildProvider 元素生成 DAL。但我很好奇为什么 Web 应用程序或 Windows 应用程序不支持BuildProvider。
PS:我知道对于 Subsonic,除了 BuildProvider 之外还有另一种选择,但我只是好奇。