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 version2
{
"Type": "InventoryAdjusted",
"Version": "2.0.0",
"Event": {
"SKU": "ABC-123",
"Adjustments": [
{
"Quantity": 10,
"ReasonCode": "Damage"
},
View version11.json
{
"Type": "InventoryAdjusted",
"Version": "1.1.0",
"Event": {
"SKU": "ABC-123",
"Quantity": 10,
"ReasonCode": "Damage"
}
}
View version1.json
{
"Type": "InventoryAdjusted",
"Version": "1.0.0",
"Event": {
"SKU": "ABC-123",
"Quantity": 10
}
}
View serialize.cs
var eventString = JsonConvert.SerializeObject(new OrderPlaced(OrderId));
View convert.cs
var eventString = JsonConvert.SerializeObject(new OrderPlaced(OrderId), new JsonSerializerSettings
{
TypeNameHandling = TypeNameHandling.All
});
View event.cs
public interface IMessage<out T>
{
string MessageType { get; }
int MessageVersion { get; }
Guid MessageId { get; }
DateTime CreatedDateTime { get; }
string Owner { get; set; }
Guid CorrelationId { get; }
Guid ResourceVersion { get; }
string Sender { get; }
View Startup.cs
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
namespace Orleans.AspNetCore.Demo
{
public class Startup
{
View OrleansHealthCheck.cs
using System;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Diagnostics.HealthChecks;
using Orleans.AspNetCore.Demo.Grains;
namespace Orleans.AspNetCore.Demo
{
public class OrleansHealthCheck : IHealthCheck
View HealthCheckGrain.cs
using System.Threading.Tasks;
using Orleans.Concurrency;
namespace Orleans.AspNetCore.Demo.Grains
{
public interface IHealthCheckGrain : IGrainWithGuidKey
{
Task<bool> IsHealthy();
}
View HomeController.cs
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Orleans.AspNetCore.Demo.Grains;
namespace Orleans.AspNetCore.Demo.Controllers
{
public class HomeController : Controller
{
private readonly IClusterClient _clusterClient;
You can’t perform that action at this time.