Skip to content

Creating GrainId #7617

Answered by ReubenBond
jbockle asked this question in Q&A
Feb 24, 2022 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

I'm not entirely sure what you're after, but perhaps I can supply a bit of detail:

A GrainId consists of two components, Type and Key, both are essentially strings.
Orleans treats the Key component as opaque.
The Type components has some meaning because it maps to grain implementation classes and if those classes are generic then the Type component will contain the encoded generic parameters (eg, my-grain`2[[int],[string]]).

Orleans.Runtime.GrainIdKeyExtensions is a static class with methods for creating Guid & long keys (encoded as strings)
You can use this to create Guid/long keys. For string keys, you can pass the string directly to GrainId.Create(...). These keys have no special meani…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jbockle
Comment options

Answer selected by jbockle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants