我正在尝试将此linq查询转换为lambda
var query = (from a in context.Table_A
join u in context.Table_B on a.scored equals u.userid
join u2 in context.Table_B on a.scorer equals u2.userid
from cs in a.Table_C //(Table_A is related to Table_C)
where (a.date>= startdate && a.date < enddate)
select new MSViewModel
{
scored= u.User.name,
scorer= u2.User.name,
subject_name = cs.Subject.name,
score = cs.score,
categoryid = cs.id,
})
.AsEnumerable()
.GroupBy(t => t.scored)
.ToList();
Run Code Online (Sandbox Code Playgroud)
到目前为止,这就是我所拥有的.我有点失去接下来要做的事情.
var tobi = db.Table_A.Join(db.Table_B,a=>a.scored,u=>u.userid,
(a,u) => new {scored=u.User.name });
db.Table_A.Join(db.Table_B,a1=>a1.scorer,u2=>u2.userid,
(a,u2)=> new {scorer= u2.User.name});
Run Code Online (Sandbox Code Playgroud) 当用户输入类似的HTML代码时,我在javascript中有一个聊天应用程序
<button>click</button>
Run Code Online (Sandbox Code Playgroud)
聊天时会出现一个按钮.我用这个代码
if(message.indexOf('<button') != -1)
{
message = message.replace(message, '-');
}
Run Code Online (Sandbox Code Playgroud)
但这只是取代了<按钮
有一个空格,我希望它显示为文本而不是实际按钮.
谢谢
我需要根据下拉列表选择更改文本的颜色.
<select id="room2">
<option>#0808cf</option>
<option>#0E9E26</option>
</select>
<input type="text" id="txtColor">
John: <p style="color:#0808cf" > test </p>
Run Code Online (Sandbox Code Playgroud)
jQuery的
$('#colors').change(function(){
$('#txtColor').val($("#colors").val());
var fontColor = $('#txtColor').val();
});
Run Code Online (Sandbox Code Playgroud)
我不希望更改在css中,因为select id不会是常量.我希望它插入到p style标签中.而且我需要将文本作为约翰:测试在一行中.我尝试了这个,但没有工作.谢谢.
<p style="color:"+fontColor+" > test </p>
Run Code Online (Sandbox Code Playgroud)
我正试图将DIV
一个新窗口传递给一个新窗口.
function openWin() {
myWindow=window.open('','','width=200,height=100');
}
Run Code Online (Sandbox Code Playgroud)
<div id="pass">pass this to the new window</div>
<a href="#" onclick="openWin();">click</a>
Run Code Online (Sandbox Code Playgroud)
有人可以帮我吗?