我在 ComponentModel.Composition 中添加了;程序集。但显示此错误
使用 System.ComponentModel.Composition;
和参考装配
仍然得到错误
CS0234:命名空间“System.ComponentModel”中不存在类型或命名空间名称“Composition”(您是否缺少程序集引用?)
我想通过检查带有一些数字的id来获取数据.
int r = 0;
var ask = from y in entity.sorulars
where y.soru_id == questionID[r]
select new { y.sorutipi_id };
foreach (var hold2 in ask)
{
questionTypeID[r] = hold2.sorutipi_id;
r++;
}
Run Code Online (Sandbox Code Playgroud)
我使用这些代码但是
"LINQ to Entities不支持LINQ表达式节点类型'ArrayIndex'."
出现错误.我猜questionID[r]不支持,LINQ所以我应该键入什么而不是它.谢谢
$scope.$on('$destroy', function (event){
$timeout.cancel(promiseObj);
});
Run Code Online (Sandbox Code Playgroud)
如果我位于正在加载的页面上(因为页面包含$http请求,因此需要时间加载数据)并且在加载时,我从导航更改页面,$timeout 不会被删除,并且连续http调用正在进行。你能帮我吗?
我试图通过使用实体框架从数据库中获取一些值
我有一个疑问
实体framewrok查询之间
new ClassName和之间的new ClassName()区别
dbContext.StatusTypes.Select(s => new StatusTypeModel() { StatusTypeId =
s.StatusTypeId, StatusTypeName = s.StatusTypeName }).ToList();
Run Code Online (Sandbox Code Playgroud)
dbContext.StatusTypes.Select(s => new StatusTypeModel { StatusTypeId =
s.StatusTypeId, StatusTypeName = s.StatusTypeName }).ToList();
Run Code Online (Sandbox Code Playgroud)
您可以看到我创建new StatusTypeModel和new StatusTypeModel()对象的位置的更改.
- 这两个查询都适合我.但我不知道代码1和代码2之间的区别.
为什么TypeScript允许重复组件implements?
import { Component,OnInit } from '@angular/core';
export class CreateVersionComponent implements OnInit, OnInit, OnInit { }// no error
export class CreateVersionComponent extends OnInit, OnInit, OnInit { }// getting error
Run Code Online (Sandbox Code Playgroud)
但它在组件扩展时抛出重复的标识符错误.
那么打字稿在实现时接受重复组件的原因是什么?我们需要使用哪种情况?
我收到了以下代码的错误
public static Moq.Mock<T> CreateInstanceOfIMock<T>() {
return new Moq.Mock<T>();
}
Run Code Online (Sandbox Code Playgroud)
我通过使用引用类型解决了它的错误class.请参阅以下代码
public static Moq.Mock<T> CreateInstanceOfIMock<T>() where T : class
{
return new Moq.Mock<T>();
}
Run Code Online (Sandbox Code Playgroud)
现在我想var mockColorsRepository = new Moq.Mock<IColorsRepository>();通过使用将此代码移动到公共代码中generics.这IColorsRepository是一个interface.所以我做了一个接口参考,T而不是class像下面这样的代码
public static Moq.Mock<T> CreateInstanceOfIMock<T>() where T : interface
{
return new Moq.Mock<T>();
}
Run Code Online (Sandbox Code Playgroud)
但我得到The type T must be a reference type in order to use it as parameter错误.我怎么可以参考interface,而不是class到T …
我们在当前项目中使用ngrx和Angular2.基本上ngrx是Redux的反应式扩展.ngrx提供单一的事实来源,数据可以从任何地方访问.
我们可以使用全局服务处理所有这些场景,但是为什么要编写已经可用和测试的相同代码.
我已经通过nuget软件包管理器控制台安装了Microsoft Owin
PM>安装包Microsoft.Owin
现在我要卸载Microsoft.Owin via nuget软件包管理器控制台
PM>卸载打包Microsoft.Owin
但是上面一行抛出了一个错误。
The term 'Uninstall-Package' is not recognized as the name of a cmdlet
通过nuget控制台可以卸载吗?
Math.fround()运作.该
Math.fround()函数返回数字的最近浮点表示.
但是当它传递浮点数时,Math.fround(1.5) 它返回相同的(1.5)值.但是当它传递浮点数时,Math.fround(1.55)它返回一个不同的值1.5499999523162841.为什么和如何?
- 我很困惑如何
Math.fround()工作.- 它与
Math.round()功能有何不同?- 另请告诉我为什么它不受支持
Internet Explorer.
我试图strictNullChecks在角度4应用程序中实现.
我刚才说 "strictNullChecks": true 的tsconfig.json
当我运行应用程序时,ng serve我得到以下错误.
ERROR in [at-loader] ./node_modules/@angular/forms/src/model.d.ts:244:39
TS2459: Type '{ onlySelf?: boolean | undefined; emitEvent?: boolean |
undefined; } | undefined' has no property 'emitEvent' and no string index signature.
Run Code Online (Sandbox Code Playgroud)
出了什么问题?我们怎样才能
strictNullChecks在角4中实现?
angular ×4
c# ×4
typescript ×3
angularjs ×2
asp.net ×2
oop ×2
class ×1
ecmascript-5 ×1
generics ×1
inheritance ×1
interface ×1
javascript ×1
linq ×1
math ×1
moq ×1
ngrx ×1
nuget ×1
ondestroy ×1
owin ×1
performance ×1
scope ×1
timeout ×1