小编ruf*_*fen的帖子

Angularjs $ http.get().然后绑定到列表

我有一个如下所示的列表:

<li ng-repeat="document in DisplayDocuments()" ng-class="IsFiltered(document.Filtered)">
    <span><input type="checkbox" name="docChecked" id="doc_{{document.Id}}" ng-model="document.Filtered" /></span>
    <span>{{document.Name}}</span>
</li>
Run Code Online (Sandbox Code Playgroud)

我在我的控制器中绑定此列表,对此:

$scope.Documents = $http.get('/Documents/DocumentsList/' + caseId).then(function(result) {
    return result.data;
});
Run Code Online (Sandbox Code Playgroud)

当这个运行时,我得不到任何结果.当我删除then方法时,我得到三个空行,使计数正常,但没有显示信息.

我知道"everthing"其他工作,因为我之前用jQuery填充了列表,我做错了什么?

这是来自服务器的响应:

{Id:3f597acf-a026-45c5-8508-bc2383bc8c12, Name:ZZ_BL0164_Skisse BL0164_945111.pdf, Order:1,…}
{Id:46f51f1f-02eb-449a-9824-8633e8ae7f31, Name:ZB_BL0201_Firmaattest BL0201_945111.pdf, Order:1,…}
{Id:fddd1979-c917-4b32-9b83-b315f66984ed, Name:ZA_BL0228_Legitimasjonsskjema BL0228_945111.pdf,…}
Run Code Online (Sandbox Code Playgroud)

get promise angularjs

50
推荐指数
3
解决办法
10万
查看次数

通过User上的自定义属性搜索Active Directory B2C

我们正在使用B2C并将客户编号存储为用户的扩展字段.单个用户可以拥有一个或多个客户,并且它们存储在逗号分隔的字符串中.

我现在正在做的事情非常低效:1.获取所有用户2.获取每个用户的扩展属性3.检查他们是否具有所需的扩展属性以及是否包含我想要的客户.4.构建我想要的用户列表.

Adclient是IActiveDirectoryClient

var users = (await GetAllElementsInPagedCollection(await AdClient.Users.ExecuteAsync())).ToList();
var customersUsers = users.Where(user => user.AccountEnabled.HasValue && user.AccountEnabled.Value).Where(user =>
    {
        var extendedProperty = ((User) user).GetExtendedProperties().FirstOrDefault(extProp => extProp.Key == customersExtendedProperty.Name).Value?.ToString();
        return extendedProperty != null && extendedProperty.Contains(customerId);
    }).ToList();
Run Code Online (Sandbox Code Playgroud)

我希望能够使用AdClient在ActiveDirectory的一个查询中执行此操作.如果我尝试这个,我会得到错误,不支持这些方法,这是有道理的,因为我假设在后台构建查询以查询Active Directory.

编辑 - 其他信息:

我能够像这样查询Graph API:

var authContext = await ActiveDirectoryClientFactory.GetAuthenticationContext(AuthConfiguration.Tenant,
AuthConfiguration.GraphUrl, AuthConfiguration.ClientId, AuthConfiguration.ClientSecret);
var url = $"https://graph.windows.net:443/hansaborgb2c.onmicrosoft.com/users?api-version=1.6&$filter={customersExtendedProperty.Name} eq '{customerId}'";
var users = await _graphApiHttpService.GetAll<User>(url, authContext.AccessToken);
Run Code Online (Sandbox Code Playgroud)

但是,在我的示例中,我需要使用substringof进行过滤,但Azure Graph API不支持此功能.

c# azure-ad-b2c

13
推荐指数
1
解决办法
906
查看次数

在客户端对象模型上使用Linq来自sharepoint

我试图在客户对象模型得到的结果上使用LINQ.

var rolesAssignments = context.Web.RoleAssignments;
context.Load(rolesAssignments, 
    roles => roles.IncludeWithDefaultProperties(role => role.Member,
    role => role.RoleDefinitionBindings));
context.ExecuteQuery();
var hasAdmin = rolesAssignments.Select(x => x.RoleDefinitionBindings.Cast<RoleDefinition>().Select(y => y.RoleTypeKind == RoleType.Administrator)).Any();
Run Code Online (Sandbox Code Playgroud)

我明白了:

{System.NotSupportedException:查询执行的使用无效.应该使用客户端上下文对象上的ExecuteQuery方法执行查询.

但是,当我重写它以使用嵌套的foreach循环时,它工作正常.

从我的linq查询中可以看到,我没有使用任何未加载的属性.

c# linq sharepoint-2010

10
推荐指数
2
解决办法
8841
查看次数

没有找到具有指定模式的包

我正在使用部署azure应用程序服务到Team Services中的插槽构建步骤,我希望能够将PackageAsSingleFile设置为False来构建我的解决方案.但是,当我尝试使用创建工件的路径发布包时,我得到"没有找到具有指定模式的包".

我是否需要创建两个工件,一个作为zip文件,一个作为文件包,以便能够做我想要的?我尝试过不同的文件夹路径,但无论如何我都会得到同样的错误.

在此输入图像描述

deployment azure azure-web-sites azure-devops azure-pipelines-release-pipeline

8
推荐指数
1
解决办法
9312
查看次数

使用nuget包向appsettings.json添加配置

我已经创建了一个nuget包,我需要在appsettings.json中添加一个部分,或者添加我自己的复制到应用程序中的配置文件,但是我无法弄清楚如何.

I want this: 
{
 "mysection" : 
  { 
        "value1": "value, 
        "value2": "value"
  }
}
Run Code Online (Sandbox Code Playgroud)

要添加到配置文件中,或者在下载nuget包时包含要复制的文件.我们正在使用visual studio teamservices来构建和托管nuget包.

.net configuration nuget-package azure-devops asp.net-core

7
推荐指数
1
解决办法
1634
查看次数

jQuery tablesorter with knockout - 添加行

我正在尝试使用tablesorter和savesort小部件.该表由knokout填充.

第一次填充表时,我得到正确的行数,并记住排序.然后我用数据重新填充表,使用ajax并绑定到knockout数组.然后数据加倍,但敲除(正确),只跟踪一半的数据.

到目前为止,我已将其跟踪到我在此方法中应用已保存的排序时:

self.tablesorter = function () {
                        $('table.tablesorterTranslation').trigger("update");
                        setTimeout(function () {
                            var sl = $.tablesorter.storage($('table.tablesorterTranslation'), 'tablesorter-savesort');
                            var sortList = (sl && sl.hasOwnProperty('sortList') && $.isArray(sl.sortList)) ? sl.sortList : '';
                            if (sortList && sortList.length > 0) {
                                // update sort change
                                $('table.tablesorterTranslation').trigger("sorton", [sortList]);
                            }
                        }, 1000);
                        return false;
                    };
Run Code Online (Sandbox Code Playgroud)

该方法由敲除后反应绑定调用.

在调用该方法之前,我对于淘汰阵列中的每个项目都有一个tablerow,在postaction之后,我有两个,一个由knockout跟踪,一个似乎是由tablesorter添加的.

这是由于tablesorter缓存值,有没有办法清理它?

html:

    <table class="tablesorterTranslation" data-bind="visible: contents().length > 0">
                <colgroup>
                    <col class="referencenumber"/>
                    <col class="title"/>
                </colgroup>
                <thead>
                    <tr>
                        <th class="referencenumber">Ref number</th>
                        <th class="title">Title</th>
                    </tr>
                </thead>
                <tbody data-bind="foreach: contents, postAction: tablesorter(), visible: contents().length …
Run Code Online (Sandbox Code Playgroud)

jquery tablesorter knockout.js

5
推荐指数
1
解决办法
1319
查看次数

VSTS上的打包nuget包'Newtonsoft.Json'已经为'NETStandard.Library'定义了依赖关系

在VSTS中打包构建使用Nuget Packager,我收到错误:

[错误]'Newtonsoft.Json'已经为'NETStandard.Library'定义了一个依赖项.

解决这个问题的大多数提示涉及更新nuget,但由于我在Team Services上构建,我无法真正做到这一点.

tfs nuget nuget-package azure-devops azure-pipelines-release-pipeline

5
推荐指数
1
解决办法
2946
查看次数

使用Azure AD B2C身份验证为服务

我们已经使用Azure AD B2C和OAuth设置了我们的应用程序,效果很好,但是我试图将其身份验证为服务,以便对服务调用进行服务。我对此并不陌生,但是我已经学习了有关Pluralsight的一些课程,以了解如何在“常规” Azure Active Directory上执行此操作,并且可以使其正常工作,但是在B2C上遵循相同的原理是行不通的。

我有这个快速控制台应用程序:

class Program
{
    private static string clientId = ConfigurationManager.AppSettings["ida:ClientId"]; //APIClient ApplicationId
    private static string appKey = ConfigurationManager.AppSettings["ida:appKey"]; //APIClient Secret
    private static string aadInstance = ConfigurationManager.AppSettings["ida:aadInstance"]; //https://login.microsoftonline.com/{0}
    private static string tenant = ConfigurationManager.AppSettings["ida:tenant"]; //B2C Tenant 
    private static string serviceResourceId = ConfigurationManager.AppSettings["ida:serviceResourceID"]; //APP Id URI For API
    private static string authority = String.Format(CultureInfo.InvariantCulture, aadInstance, tenant);

    private static AuthenticationContext authContext = new AuthenticationContext(authority);
    private static ClientCredential clientCredential = new ClientCredential(clientId, appKey);

    static void Main(string[] args)
    { …
Run Code Online (Sandbox Code Playgroud)

azure oauth-2.0 azure-ad-b2c

5
推荐指数
1
解决办法
1297
查看次数

使用clientaccesspolicy.xml在浏览器中使用提升权限的Silverlight 5

我试图让我的silverlight应用程序在浏览器中以提升的权限运行.但是,无论我做什么,它都不会升高.

我试图添加注册表项AllowElevatedTrustAppsInBrowser(作为值为1的DWORD),并使用VS 2012签署XAP文件.我还遇到了一个提到clientaccesspolicy.xml文件的博客,但我无法允许提升权限无论是.我把xml文件放在托管显示XAP的html文件的web项目中.

有没有人真的设法让这个运行?

我也尝试过这样做:http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2011/04/27/silverlight-5-beta-rough-notes-trusted-apps-in-the-browser.aspx但是我不确定在Windows上运行命令的位置.

c# silverlight silverlight-5.0

4
推荐指数
1
解决办法
5656
查看次数

nservicebus - 多个端点错误

我收到这条消息:

主机不支持托管多个端点.找到的端点类:foo.bar.Service.Endpoint.PublisherConfig,foo.bar.Service.Endpoint,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = null,foo.bar.Service.Endpoint.PublisherConfig,foo.bar. Service.Endpoint,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = null您的运行时目录中可能有一些旧程序集.尝试右键单击VS项目,然后选择"清除".

我试过清理这个项目,没有运气.如果我关闭VS并重建解决方案,它会工作一次,然后再次停止工作.这也是我在网上找到的唯一解决方案.

我觉得奇怪的是,它似乎说两次找到相同的端点?

编辑:我看了bin文件夹,并创建了文件.我找到了这些文件:

foo.bar.Service.Endpoint.dll foo.bar.Service.Endpoint.mm.dll

将它与同事bin文件夹进行比较,他没有.mm.dll文件,他的工作正常.系统的差异,是我运行win8,他运行win7.vs2012和相同的源代码等...

当我删除.mm.dll文件时,它会工作并运行,但重建时会再次出现.

c# nservicebus

4
推荐指数
1
解决办法
1506
查看次数

XmlSerializer - 包含text + xml + text的节点

我有一个节点,可以包含text或xml,text + xml或text + xml + text.我解决使用的前两种情况

    [XmlAnyElement]
    [EditorBrowsable(EditorBrowsableState.Never)]
    public XmlElement[] TextNodes { get; set; }

    [XmlText]
    public string InnerText { get; set; }

    [XmlIgnore]
    public string Text 
    {
        get
        {
            return String.Format("{0}{1}", InnerText, TextNodes.Aggregate(String.Empty, (current, documentNode) => current + documentNode.OuterXml));
        }
    }
Run Code Online (Sandbox Code Playgroud)

但是,在xml之后有文本的最后一种情况我无法找到解决方案.

XML

<node>
 somtext <p>moretext</p> even more text
</node>
Run Code Online (Sandbox Code Playgroud)

我的代码将在Text中输出:

sometext <p>moretext</p>
Run Code Online (Sandbox Code Playgroud)

我需要:

sometext <p>moretext</p> even more text
Run Code Online (Sandbox Code Playgroud)

c# xml xml-deserialization

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

通过 Microsoft Appcenter 将 VSTS 构建分发到 Play 商店

我有一个在 VSTS 中为我​​的应用程序运行的构建,我想通过 Microsoft appcenter 分发这些构建。但是,我找不到直接分发到 Play 商店的方法,只能分发给分发组。

对于通讯组,我所做的就是在 VSTS 发布任务的发布步骤中添加正确的 ID。我在 VSTS 中使用将“AppName”部署到 Visual Studio App Center 任务: 通讯组 ID 但是,不同的 Play 商店(或应用商店)分发选项没有相同的 Id。

azure-devops visual-studio-app-center

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

从 Azure databricks 连接到 Azure 表存储

我正在尝试从 Databricks 连接到 azure 表存储。我似乎找不到任何不进入 blob 容器的资源,但我尝试修改表的资源。

spark.conf.set(
  "fs.azure.account.key.accountname.table.core.windows.net",
  "accountkey")

blobDirectPath = "wasbs://accountname.table.core.windows.net/TableName"

df = spark.read.parquet(blobDirectPath)
Run Code Online (Sandbox Code Playgroud)

我现在假设表格是镶木地板文件。我现在收到此代码的身份验证错误。

python azure-table-storage pyspark azure-databricks

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