小编Saj*_*ran的帖子

System.Collections.Generic.List不包含'Select'的定义

我的"Views"文件夹中的许多文件都发生了此错误:

'System.Collection.GenericList'不包含'Select'的定义,可以找到接受类型'System.Collections.GenericList'的第一个参数(你是否缺少using指令或程序集引用?)

我尝试在文件顶部附近添加一堆"使用System ..."和其他基本库,但添加这些文件似乎没有任何帮助.

这是我发生错误的地方,该行在以下行开头.BindTo(Model.Users.Select(o => o.UserName)):

任何帮助将不胜感激.谢谢!

 <div id="editRolesContainer" class="detailContainer detailContainer4">
    <header class="sectionheader"> Add Roles </header>
    <ul id = "AdminSelectUserContainer" >
       <li>
          <ul style="padding: 0 0 0 5px">
             <li>Select User : </li>
             <li>
                @using (Html.BeginForm("srch_GetUserRoles", "Admin",
                   new { view = "Users_Roles" }, FormMethod.Post,
                   new { name = "srch_GetUserRoles" }))
                {
                   @(Html.Telerik().AutoComplete()
                          .Name("acx_SelectUser")
                          .BindTo(Model.Users.Select(o => o.UserName))
                              .HtmlAttributes(new { type "submit"   })
                          .HtmlAttributes(new { @class = "SearchBox"})
                          .AutoFill(true)
                          .Filterable((filtering =>
                              {
                                 filtering.FilterMode(AutoCompleteFilterMode.Contains);
                              }))
                  )
                }
             </li>
            </ul>
           ...
           ... …
Run Code Online (Sandbox Code Playgroud)

c# linq

65
推荐指数
3
解决办法
9万
查看次数

如何全局声明管道以在不同的模块中使用?

现在我有一个名为的自定义管道 CurrConvertPipe

import {Pipe, PipeTransform} from '@angular/core';
import {LocalStorageService} from './local-storage';
@Pipe({name: 'currConvert', pure: false})
export class CurrConvertPipe implements PipeTransform {
  constructor(private currencyStorage: LocalStorageService) {}

  transform(value: number): number {
     let inputRate = this.currencyStorage.getCurrencyRate('EUR');
    let outputputRate = this.currencyStorage.getCurrencyRate(localStorage.getItem('currency'));
    return value / inputRate * outputputRate;
  }
}
Run Code Online (Sandbox Code Playgroud)

我需要在两个不同的模块中使用它,

import './rxjs-extensions';
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { …
Run Code Online (Sandbox Code Playgroud)

pipe typescript angular

51
推荐指数
4
解决办法
4万
查看次数

Microsoft Azure DocumentDB与Azure表存储

近几年来,微软提供了一个名为"Table Storage"的"NoSQL"密钥/值存储(http://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-how-to-use-表/)

表存储提供高性能,可扩展性(通过分区)和相对较低的成本.Table的主要缺点是只能对Partition和Row键建立索引 - 因此对值进行查询效率非常低.

最近,微软宣布了一项名为"DocumentDB"的新"NoSQL"服务(http://azure.microsoft.com/en-us/documentation/services/documentdb/)

DocumentDB存储JSON对象,而不是存储属性列表(如Tables do).整个对象被索引 - 因此可以基于存储对象的每个属性和任何嵌套属性创建有效的查询.

微软表示,DocumentDB也提供了高性能和可扩展性.

如果是这样 - 为什么有人会使用Table Storage而不是DocumentDB?听起来DocumentDB提供与Tables相同的功能,但具有其他功能,例如索引任何内容的功能.

如果有人能够在DocumentDB和Table Storage之间进行比较,我会很高兴,强调每个人的利弊.

azure azure-table-storage azure-cosmosdb

43
推荐指数
3
解决办法
2万
查看次数

将数据从子组件传递到父组件Angular2

我有一个名为search_detail的组件,其中包含另一个名为calendar的组件,

SearchDetail_component.html

 <li class="date">
   <div class="btn-group dropdown" [class.open]="DatedropdownOpened">
   <button type="button" (click)="DatedropdownOpened = !DatedropdownOpened"   class="btn btn-default dropdown-toggle" data-toggle="dropdown"
aria-haspopup="true" [attr.aria-expanded]="dropdownOpened ? 'true': 'false'">
      Date <span class="caret"></span>
  </button>
  <ul class="dropdown-menu default-dropdown">
     <calendar  ></calendar>
     <button > Cancel </button>
     <button (click)="setDate(category)"> Ok </button>
   </ul>                            
 </div>
</li>
Run Code Online (Sandbox Code Playgroud)

SearchDetail_component.ts

import 'rxjs/add/observable/fromEvent';
@Component({
    selector: 'searchDetail',
    templateUrl: './search_detail.component.html',
    moduleId: module.id

})
Run Code Online (Sandbox Code Playgroud)

Calendar.component.ts

import { Component, Input} from '@angular/core'; 
@Component({
    moduleId:module.id,
    selector: 'calendar',
    templateUrl: './calendar.component.html'
})

    export class CalendarComponent{
      public fromDate:Date = new Date();    
      private toDate:Date = new Date(); …
Run Code Online (Sandbox Code Playgroud)

javascript components typescript angular

39
推荐指数
1
解决办法
6万
查看次数

Azure devops部署失败:TypeError:无法读取未定义的属性'scmUri'

在使用Azure Devops将我的应用程序部署到azure环境时,我一直面临着这个问题.

其中一个部署任务失败,并显示以下错误消息:

## [debug]部署失败,错误:TypeError:无法读取未定义的属性'scmUri'

当我重试部署几次成功并部署成功完成时.

导致此错误的问题是什么?

azure azure-deployment azure-devops azure-pipelines-release-pipeline

29
推荐指数
1
解决办法
2227
查看次数

pyodbc返回的行不是JSON可序列化的

我试图在Python中使用pyobc库检索表的行.

我能够成功检索表的表和字段.现在我有一个名为"apx_roomtypes"的表,其数据如下,

在此输入图像描述

但是,当我将pyodbc行附加到列表然后尝试将列表转储到JSON时,我得到错误

TypeError:(1,'标准','对于5个成员',123)不是JSON可序列化的

这是python代码:

class execute_query:
    def GET(self,r):
          web.header('Access-Control-Allow-Origin',      '*')
          web.header('Access-Control-Allow-Credentials', 'true')
          cnxn = pyodbc.connect(connection_string)
          data = []
          cursor = cnxn.cursor()
          query = web.input().query
          cursor.execute(query)
          rows = cursor.fetchall()
          for row in rows:
              data.append(row)
          return json.dumps(data)
Run Code Online (Sandbox Code Playgroud)

我该如何解决这个错误?

python sql-server json

15
推荐指数
1
解决办法
8186
查看次数

无法读取未定义的属性"过滤器"

我收到如下错误:

Cannot read property 'filter' of undefined.
Run Code Online (Sandbox Code Playgroud)

组件模板:

<input #input placeholder="Search" id="search">
<div class="item" *ngFor="let item of data | searchPipe: input.value">
  {{item}}
</div>
Run Code Online (Sandbox Code Playgroud)

管道代码:

@Pipe({
  name: 'searchPipe',
  pure: false
})
export class SearchPipe implements PipeTransform {
  transform(data: any[], searchTerm: string): any[] {
    searchTerm = searchTerm.toUpperCase();
    return data.filter(item => {
      return item.toUpperCase().indexOf(searchTerm) !== -1 
    });
  }
}
Run Code Online (Sandbox Code Playgroud)

是什么导致错误?

typescript angular

13
推荐指数
2
解决办法
4万
查看次数

如何获取离子的输入文本值

我正在尝试获取input文本值并将其存储在名为input中的变量中ionic。但是我尝试并失败了。谁能告诉我我做错了什么吗?

这是我的 HTML

  <ion-content>
  <ion-list>
    <ion-item> 
        <ion-label stacked>display</ion-label>
      <ion-input type="text" text-right id="input" ></ion-input>
    </ion-item>    
  </ion-list>
  </ion-content>
Run Code Online (Sandbox Code Playgroud)

这是我home.ts的离子

import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {

  constructor(public navCtrl: NavController) {
    var input=document.getElementById('input').nodeValue;
    document.getElementById('seven').innerHTML=input;
  }

}
Run Code Online (Sandbox Code Playgroud)

谁能帮帮我吗?

html ionic-framework angular

13
推荐指数
2
解决办法
3万
查看次数

Linq查询过滤列表中的id c#

我有一个结果列表列表,其中包含List里面的内容.我有另一个列表,其中只包含List.我想使用数据中的linq查询进行过滤,它应返回包含第二个技能ID的所有数据名单.

var list = this._viewModel.Data.Select(T => T.SkillsList);
var filtered = item.Skills.Contains(list.Where(t=>t.ToString()).ToList();
Run Code Online (Sandbox Code Playgroud)

从第一个列表中它包含技能列表中的小数列表; item.Skills包含字段为技能和代码的列表.item是另一个包含技能列表的对象.

c# linq collections list observable

12
推荐指数
1
解决办法
3万
查看次数

找不到模块'@ firebase/app-types/private' - Firebase抛出错误

我正在使用angular和firebase进行应用程序.我按照现场给出的说明安装了firebase,版本如下,

"angularfire2": "^5.0.0-rc.4",
"firebase": "^4.8.1",
Run Code Online (Sandbox Code Playgroud)

但是出现以下错误

node_modules/@firebase/database/dist/esm/src/api/Database.d.ts(4,33)中的错误:错误TS2307:找不到模块'@ firebase/app-types/private'.node_modules/@firebase/database/dist/esm/src/core/AuthTokenProvider.d.ts(1733):错误TS2307:找不到模块'@ firebase/app-types/private'.

npm firebase angularfire angularfire2 angular

12
推荐指数
2
解决办法
1万
查看次数