Skip to content

Commit

Permalink
Clean up code
Browse files Browse the repository at this point in the history
  • Loading branch information
zh6335901 committed Jan 15, 2024
1 parent 86bc7ec commit f520d6b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions samples/SimpleSample.Silo/BlobStorageEventStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ public BlobStorage(BlobServiceClient blobServiceClient, IMemoryCache memoryCache
var method = typeof(BinaryData)
.GetMethods()
.First(x => x.Name == nameof(BinaryData.ToObjectFromJson));

_toObjectFromJson = (data, type) =>
{
var genericMethod = method!.MakeGenericMethod(type);
var result = (Event) genericMethod.Invoke(data, new object?[] { null })!;
var genericMethod = method.MakeGenericMethod(type);
var result = (Event)genericMethod.Invoke(data, new object[] { null });
return result;
};
}
Expand Down Expand Up @@ -129,5 +130,4 @@ private async Task<BlobContainerClient> GetContainer(string grainTypeName, Grain

return container;
}

}

0 comments on commit f520d6b

Please sign in to comment.