Content-Length: 453661 | pFad | http://github.com/Weidaicheng/tye/commit/fae47325b0c8d7dafcdec5d1248191b24b2adc23

13 Finalizing dapr fixes (#756) · Weidaicheng/tye@fae4732 · GitHub
Skip to content

Commit fae4732

Browse files
authored
Finalizing dapr fixes (dotnet#756)
1 parent 77ebc0d commit fae4732

File tree

6 files changed

+13
-9
lines changed

6 files changed

+13
-9
lines changed

samples/dapr/orders/Controllers/OrdersController.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace orders.Controllers
1010
[ApiController]
1111
public class OrdersController : ControllerBase
1212
{
13-
[Topic("orderplaced")]
13+
[Topic("messagebus", "orderplaced")]
1414
[HttpPost("orderplaced")]
1515
public async Task PlaceOrder(Order order, [FromServices] DaprClient dapr, [FromServices] ILogger<OrdersController> logger)
1616
{
@@ -49,7 +49,7 @@ public async Task PlaceOrder(Order order, [FromServices] DaprClient dapr, [FromS
4949
};
5050
}
5151

52-
await dapr.PublishEventAsync("orderprocessed", confirmation);
52+
await dapr.PublishEventAsync("messagebus", "orderprocessed", confirmation);
5353

5454
logger.LogInformation("Sent confirmation for order {OrderId}", order.OrderId);
5555

samples/dapr/orders/orders.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="Dapr.AspNetCore" Version="0.8.0-preview01" />
8+
<PackageReference Include="Dapr.AspNetCore" Version="0.11.0-preview02" />
99
</ItemGroup>
1010

1111
</Project>

samples/dapr/products/products.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="Dapr.AspNetCore" Version="0.8.0-preview01" />
8+
<PackageReference Include="Dapr.AspNetCore" Version="0.11.0-preview02" />
99
</ItemGroup>
1010

1111
</Project>

samples/dapr/store/Shared/ProductDisplay.razor

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
var task = Broker.GetOrderConfirmationAsync(orderId, cts.Token);
4848

49-
await Dapr.PublishEventAsync("orderplaced", new Order()
49+
await Dapr.PublishEventAsync("messagebus", "orderplaced", new Order()
5050
{
5151
ProductId = Product.Id,
5252
OrderId = orderId,

samples/dapr/store/Startup.cs

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Linq;
4+
using System.Text;
45
using System.Text.Json;
56
using System.Threading.Tasks;
67
using Microsoft.AspNetCore.Builder;
@@ -63,9 +64,12 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
6364
var broker = endpoints.ServiceProvider.GetRequiredService<OrdersEventBroker>();
6465
endpoints.MapPost("/orderprocessed", async context =>
6566
{
66-
var confirmation = await JsonSerializer.DeserializeAsync<OrderConfirmation>(context.Request.Body);
67+
var confirmation = await JsonSerializer.DeserializeAsync<OrderConfirmation>(context.Request.Body, new JsonSerializerOptions()
68+
{
69+
PropertyNameCaseInsensitive = true
70+
});
6771
broker.Complete(confirmation);
68-
}).WithTopic("orderprocessed");
72+
}).WithTopic("messagebus", "orderprocessed");
6973
});
7074
}
7175
}

samples/dapr/store/store.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="Dapr.AspNetCore" Version="0.8.0-preview01" />
8+
<PackageReference Include="Dapr.AspNetCore" Version="0.11.0-preview02" />
99
</ItemGroup>
1010

1111
</Project>

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/Weidaicheng/tye/commit/fae47325b0c8d7dafcdec5d1248191b24b2adc23

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy