是否有与 Rails Console 等效的 .NET 版本?
Rails Console 对于直接检查模型的健全性非常有用。是否有 ASP.NET MVC 等效项?
是否可以使用 LinqPAD 模拟 Rails 控制台行为?
Rails Console is so useful for direct sanity-checking of your model. Is there an ASP.NET MVC equivalent?
Is it possible to mimic Rails Console behaviour using LinqPAD?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
并非如此,因为您不像使用 Rails Console 那样进入正在运行的应用程序。- 正如 Lloyd 在他的回答中所示,这似乎很有可能。如果立即窗口足以满足您想要实现的目标,那么使用立即窗口似乎仍然更容易。无论如何,LINQPad 都很棒,我使用它的方式与使用 Ruby Interactive Ruby Shell (IRB) 的方式类似。
Visual Studio 中的立即窗口调试器可以让您接近与 Rails Console 提供的体验相同。我希望 C# 5.0 能让我们更接近,因为现在您 不能使用 lambda 表达式 等。
Not really, since you're not inside the running application in the same way as with the Rails Console.- As Lloyd shows in his answer, it seems to be very much possible. Still seems that it's easier to use the Immediate Window if it is sufficient for what you are trying to achieve.LINQPad is great anyway and I use it similarly to how I use the Ruby Interactive Ruby Shell (IRB).
The Immediate Window in the Visual Studio debugger can get you close to the same experience as the Rails Console gives. I hope that C# 5.0 will get us even closer because as of now you can't use lambda expressions and such.
太棒了 - 我发现 LinqPAD 4.38.03(最新测试版)作为 Rails Console 的替代品运行得非常好!
我的 ASP.NET MVC3 项目基于 Entity Framework 4.2(使用“数据库优先”方法),Linqpad 与它很好地集成。我能够将我的程序集作为连接引用,并以交互方式查询模型、控制器、存储库等,就像在 Rails Console 中一样!
这些是我的步骤
最后,在查询窗口中选择新的程序集连接作为“数据库”,就是这样!您现在可以交互地使用您的程序集。
例如,要检查和测试控制器:(首先,在查询属性中,添加对 System.Web.Mvc 的引用)
“发布”一些数据
以查看数据库中的新客户
,或者如果你有一个存储库
awesome - I discovered LinqPAD 4.38.03 (latest beta version) works perfectly well as a Rails Console substitute!
My ASP.NET MVC3 project is based on Entity Framework 4.2 (using the "database first" approach) which Linqpad integrates nicely with. I am able to reference my assembly as a connection and query the model, controller, repositories etc. interactively, just like in Rails Console!
These were my steps
Finally, in your query window select your new assembly connection as the "Database" and that's it! You can now work with your assembly interactively.
For example, to inspect and test a controller: (first, in Query Properties, add a reference to
System.Web.Mvc
)to "post" some data
to see your new Customer in the database
or if you have a repository