嗨,我有一个用于创建带有主题和订阅的ServiceBus的ARM模板。但是我只能完成1个主题-1个订阅,因为我无法进行嵌套循环来为每个主题创建多个订阅。
我希望我可以执行这样的模板:
参数:
{
"serviceBusName": "mybus",
"topics":
[
{
"topicName": "mytopic1",
"subscriptions": [ "mysubscription1", "mysubscription2"]
},
{
"topicName": "mytopic2",
"subscriptions": [ "mysubscription1"]
}
]
}
Run Code Online (Sandbox Code Playgroud)
这是我的实际模板:
{
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"ServiceBusNamespaceName": {
"type": "string"
},
"ServiceBusSku": {
"type": "string",
"allowedValues": [
"Basic",
"Standard"
],
"defaultValue": "Standard"
},
"ServiceBusSmallSizeTopicInMb": {
"type": "int",
"defaultValue": 1024
},
"ServiceBusMaxSizeTopicInMb": {
"type": "int",
"defaultValue": 1024
},
"Topics": {
"type": "array"
}
},
"variables": {
"DefaultSASKeyName": "RootManageSharedAccessKey",
"DefaultAuthRuleResourceId": "[resourceId('Microsoft.ServiceBus/namespaces/authorizationRules', parameters('ServiceBusNamespaceName'), variables('DefaultSASKeyName'))]",
"SbVersion": "2017-04-01" …Run Code Online (Sandbox Code Playgroud) servicebus azure azureservicebus azure-resource-manager azure-servicebus-topics
我们有一个核心库,可以进行复杂的计算,我们认为它很关键,我们希望在该库上有100%的代码覆盖率.我们现在有96%这是伟大的,但由于这个类我们不能得到100%:
public class IoCModule : Autofac.Module
{
protected override void Load(Autofac.ContainerBuilder builder)
{
builder.RegisterType<SomeMathServiceA>().As<ISomeMathServiceA>();
builder.RegisterType<SomeMathServiceB>().As<ISomeMathServiceB>();
//... more registrations
}
}
Run Code Online (Sandbox Code Playgroud)
我不知道如何测试它,或者我们是否真的需要测试它.
我尝试过一个单元测试,它接受这个模块并创建IContainer并解析每个寄存器依赖项,但是有些服务访问DB和配置文件,这些文件在这种情况下非常复杂.
我该如何映射?
从:Expression<Func<TEntity, bool>>
到:Expression<Func<TDbEntity, bool>>
where TEntity: class, new() and TDbEntity: class, new()
Run Code Online (Sandbox Code Playgroud)
TEntity来自Domain,TDbEntity来自Infrastructure层,但具有相同的属性.
有可能的?