Skip to content

Instantly share code, notes, and snippets.

Derek Comartin dcomartin

Block or report user

Report or block dcomartin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View view.cs
using System;
using MediatR;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.eShopWeb.Infrastructure.Data;
View MyOrders.cs
using System;
using MediatR;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.eShopWeb.Infrastructure.Data;
View MyOrders.cshtml
@model IEnumerable<OrderViewModel>
@{
ViewData["Title"] = "My Order History";
}
<div class="esh-orders">
<div class="container">
<h1>@ViewData["Title"]</h1>
<article class="esh-orders-titles row">
<section class="esh-orders-title col-xs-2">Order number</section>
View MyOrders.cs
using MediatR;
using Microsoft.eShopWeb.ApplicationCore.Interfaces;
using Microsoft.eShopWeb.ApplicationCore.Specifications;
using Microsoft.eShopWeb.Web.ViewModels;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace Microsoft.eShopWeb.Web.Features.MyOrders
View repro.cs
using System.Collections.Generic;
using System.Linq;
using System.Linq.Dynamic;
using Xunit;
namespace FullCircleTMS.Tests.Shared
{
public class DynamicLinqTests
{
[Fact]
View idtoken.json
{
"Type": "AdjustInventory",
"IDToken": "cuYjGsoAqWl8QJugTpSY",
"Version": "1.0.0",
"Command": {
"SKU": "ABC-123",
"Quantity": 10
}
}
View senderID.json
{
"Type": "InventoryAdjusted",
"SenderID": "123",
"Version": "1.0.0",
"Event": {
"SKU": "ABC-123",
"Quantity": 10
}
}
View handler.cs
void Handler(InventoryAdjusted msg)
{
using(var trx = db.BeginTransaction())
{
db.Execute("INSERT INTO EventConcurrency (Handler, MessageID) VALUES (@handler, @messageID)", "AdjustInventory", msg.ID);
db.Execute("UPDATE Inventory SET Quantity=Quantity + @qty WHERE SKU=@sku", msg.Event.Quantity, msg.Event.SKU);
trx.Commit();
}
View event.json
{
"ID": "a0306674-17e0-4617-9470-44f2c41483be",
"Type": "InventoryAdjusted",
"Version": "1.0.0",
"Event": {
"SKU": "ABC-123",
"Quantity": 10
}
}
View version2
{
"Type": "InventoryAdjusted",
"Version": "2.0.0",
"Event": {
"SKU": "ABC-123",
"Adjustments": [
{
"Quantity": 10,
"ReasonCode": "Damage"
},
You can’t perform that action at this time.