LINQ-to-SQL有几种方法,包括可视化器加载项,用于从IQueryable查看生成的SQL.
我找不到Entity Framework 4的等价物.在StackOverflow上没有任何内容,没有博客.怎么做?
我希望能够在代码中完成它,而不必实际执行查询只是为了查看它.
谢谢!
@Tomasp有几个博客条目(这里是一个),它指的是一种使用[<ReflectedDefinition>]
和ResolveTopDefinition
从方法中提取引用的方法,作为包装定义的替代方法<@ ... @>
(或者是<@@ ... @@>
吗?).
在任何情况下,我现在无法得到任何这些东西进行编译,我认为这些功能已经改变了 - 但我不知道在谷歌这些名称中发现的或者相关的唯一提及Tomas的博客和工作.
目前的方式是什么?
我已经看过Eval.TryGetReflectedDefinition,但这需要一个MethodBase,并且这种方法似乎不应该是必要的,除非我试图反思另一个/已编译的程序集.
谢谢!
/// Colored printf
let cprintf c fmt =
Printf.kprintf
(fun s ->
let old = System.Console.ForegroundColor
try
System.Console.ForegroundColor <- c;
System.Console.Write s
finally
System.Console.ForegroundColor <- old)
fmt
// Colored printfn
let cprintfn c fmt =
cprintf c fmt
printfn ""
Run Code Online (Sandbox Code Playgroud)
有了上面被盗的代码,
cprintfn ConsoleColor.Yellow "This works"
Run Code Online (Sandbox Code Playgroud)
但
cprintfn ConsoleColor.Yellow "This %s" "doesn't"
(cprintfn ConsoleColor.Yellow) "still %s" "doesn't"
(cprintfn ConsoleColor.Yellow "still %s") "doesn't"
cprintfn ConsoleColor.Yellow ("still %s" "doesn't")
Run Code Online (Sandbox Code Playgroud)
我知道这与做Printf.TextWriterFormat<_>
VS简单的字符串,但即使指定类型fmt
,如cprintf c (fmt:Printf.TextWriterFormat<_>)
,我不能得到kprintf部分工作.我阅读了一些与日志记录相关的答案,但我仍然无法弄明白.cprintf是否可以采用格式参数?
这一定很简单,但还没有破解它......
在 vue 中,我想我知道如何将props从父组件传递给子组件。而且我知道我data
在 vue 实例的成员中有一个应用程序状态。我不明白的是如何将data
状态作为道具进入根应用程序。
似乎有几种方法可以组织 vue 应用程序,所以这就是我正在努力的工作:
索引.ts
import app from './app.vue'
export default new Vue({
// App Root Element
el: '#app',
render: (c) => c('app'),
components: {
app
},
data: {
someValue: 42
}
})
Run Code Online (Sandbox Code Playgroud)
应用程序
<template>
<div>
Some Value: {{someValue}}
</div>
</template>
<script lang="ts">
export default {
props: ['someValue']
};
</script>
Run Code Online (Sandbox Code Playgroud)
我认为它应该类似于以下内容,但我不知道如何直接引用data
- 除非我为此目的在 vue 之外保留对它的引用,但这似乎没有必要:
render: (c) => c('app', { someValue: ??? }),
Run Code Online (Sandbox Code Playgroud)