首页 \ 问答 \ If-Else in View?(If-Else in View?)

If-Else in View?(If-Else in View?)

我在C#应用程序中有这个代码:

EmployeeFirstName = gc.Key.CommissionType.GetValueOrDefault() == CommissionTypeTypes.Personal ? gc.Select(ec => ec.EmployeeFirstName).FirstOrDefault() : string.Empty, //c.EmployeeFirstName,

我想在SQL中使用它

这意味着如果我的列“CommissionType”是char'P',则从EmployeeFirstName获取值(并连接它),如果不是,则将其设为null。

列是:EmployeeFirstName,CommissionType。


I have this code in my C# application:

EmployeeFirstName = gc.Key.CommissionType.GetValueOrDefault() == CommissionTypeTypes.Personal ? gc.Select(ec => ec.EmployeeFirstName).FirstOrDefault() : string.Empty, //c.EmployeeFirstName,

and I want to have it in SQL

That means if my column "CommissionType" is the char 'P', take the value from EmployeeFirstName (and connect it), if not, make it null.

Columns are: EmployeeFirstName, CommissionType.


原文:https://stackoverflow.com/questions/24831893
更新时间:2023-03-23 22:03

最满意答案

https://code.visualstudio.com/docs/extensionAPI/api-debugging的以下部分解释了在遇到断点时会发生什么:

“每当程序停止时(在程序输入时,由于遇到断点,发生异常,或者用户请求执行暂停),调试适配器必须发送具有适当原因和线程ID的已停止事件。收到时VS代码将请求给定线程的堆栈跟踪(堆栈帧列表)。如果用户然后钻入堆栈帧,VS代码首先请求堆栈帧的范围,然后请求范围的变量。如果变量是VS Code本身是结构化的,它通过附加的变量请求来请求它的属性。这导致了以下层次结构:......“

调试适配器测试在这里: https//github.com/Microsoft/vscode-node-debug/blob/master/src/tests/adapter.test.ts他们测试典型的VS代码方案。 您可能希望查看“应该在断点处停止”测试(第108行)。

为了节省空间,“停止原因”现在显示在CALL STACK视图的标题中:

在此处输入图像描述


The following section from https://code.visualstudio.com/docs/extensionAPI/api-debugging explains what happens when a breakpoint is hit:

"Whenever the program stops (on program entry, because a breakpoint was hit, an exception occurred, or the user requested execution to be paused), the debug adapter has to send a stopped event with the appropriate reason and thread id. Upon receipt VS Code will request the stacktrace (a list of stack frames) for the given thread. If the user then drills into the stack frame, VS Code first requests the scopes for a stack frame, and then the variables for a scope. If a variable is itself structured, VS Code requests its properties through additional variables requests. This leads to the following hierarchy:..."

Debug adapter tests are here: https://github.com/Microsoft/vscode-node-debug/blob/master/src/tests/adapter.test.ts They test typical VS Code scenarios. You might want to look into the 'should stop on a breakpoint' test (line 108).

To save space the "stop reason" is now shown in the header of the CALL STACK viewlet:

enter image description here

相关问答

更多
  • 当断点与解析树不同步时,会发生这种情况。 转到“断点”窗格(Debug,Windows,Breakpoints)并从中删除它。 This would happen when the breakpoint gets out of sync from the parse tree. Go to the Breakpoints pane (Debug, Windows, Breakpoints) and delete it from there.
  • 通过打开Breakpoint Navigator(View-> Navigators-> Show Breakpoint Navigator或⌘7)来设置malloc_error_break()上的断点,单击左下角的加号按钮,然后选择“添加符号断点”。 在出现的弹出窗口中,在“符号”字段中输入malloc_error_break ,然后单击“完成”。 编辑:openfrog添加了一个屏幕截图,并表示他已经尝试这些步骤没有成功,我发布了我的答案。 有了这个编辑,我不知道该说什么。 我没有看到无法自己工作,而且 ...
  • https://code.visualstudio.com/docs/extensionAPI/api-debugging的以下部分解释了在遇到断点时会发生什么: “每当程序停止时(在程序输入时,由于遇到断点,发生异常,或者用户请求执行暂停),调试适配器必须发送具有适当原因和线程ID的已停止事件。收到时VS代码将请求给定线程的堆栈跟踪(堆栈帧列表)。如果用户然后钻入堆栈帧,VS代码首先请求堆栈帧的范围,然后请求范围的变量。如果变量是VS Code本身是结构化的,它通过附加的变量请求来请求它的属性。这导致了以 ...
  • 您将字符串分配给_Bool类型的类型。 您可能已经收到警告,指出您正在指定一个整数类型的指针,或类似的东西。 您应该使用0或1作为_Bool类型。 You are assigning a string to a type which is of _Bool type. You probably have got warning which says that you are assigning a pointer to an integer type, or something like that. You ...
  • 只要您要查找的字符串不以任何方式进行硬编码,此技巧就会起作用。 如果字符串被传递给编译器,那么这个技巧可能无效。 确保已在JDK旁边安装源代码。 打开java.lang.String类文件。 您的IDE应该自动显示此类的源代码。 在char[]字段变量中放置一个断点。 变量名称可能因每个JDK而异。 在我的机器上它是private final char value[]; 。 在这个断点上加上一个条件,例如: value!=null && value.length==6 && value[0]=='f' && ...
  • 看起来你正在触发代码中的断点 。 这意味着您的IDE正在停止执行代码,因此您可以在代码中的该步骤查看变量的状态等。 大多数IDE左侧都有一个点或箭头,您可以点击它来打开和关闭断点。 否则,请查看如何关闭正在使用的IDE的断点。 It looks like you're triggering a breakpoint in your code. This means that your IDE is stopping the code in execution so you can look at the s ...
  • 当然你必须设置breakpont并右键单击它。 从上下文菜单中选择“Condition ...”并在那里键入变量名称。 并选择“是真的”。 在条件字段中,您可以编写if语句中的表达式。 Sure You have to set breakpont and right click on it. From context menu choose "Condition..." and type your variable name there. And select "Is true". In condition ...
  • 断点通常通过替换断点位置处的指令来实现(请参阅BreakPoint )。 这意味着你的进程可能会使用dll的更改版本,foo~.dll表示,但IDE的其他进程正在使用原始的foo.dll。 这就是为什么他们不会打破。 Breakpoint is typically implemented by replacing the instruction at the location of the breakpoint (see BreakPoint). That means your process is lik ...
  • 我的坏代码似乎崩溃了GDB本身。 不,不是的。 这个: 381 } (gdb) Warning: Cannot insert breakpoint 0. Cannot access memory at address 0x0 0x0000000000000000 in ?? () (gdb) Cannot find bounds of current function 通常意味着您的程序已跳转到位置0,并且GDB无法为step命令设置内部断点。 这种“返回0”的最可能原因是堆栈损坏:你用0覆盖了你的 ...
  • 我忘了包含@import“breakpoint”; 在我的文件的顶部。 即使它被包含在其他地方,我也必须将它放在我正在使用的每个文件中。 I forgot to include @import "breakpoint"; at the top of my file. Even though it was included elsewhere, I had to actually put it in each file that I was using..

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)