/// <summary> /// Creates a new <see cref="GrainType"/> instance. /// </summary> public static GrainId Create(GrainType type, string key) => new(type, IdSpan.Create(key));
/// <summary> /// Creates a new <see cref="GrainType"/> instance. /// </summary> private GrainId(SerializationInfo info, StreamingContext context) { Type = new GrainType(IdSpan.UnsafeCreate((byte[])info.GetValue("tv", typeof(byte[])), info.GetInt32("th"))); Key = IdSpan.UnsafeCreate((byte[])info.GetValue("kv", typeof(byte[])), info.GetInt32("kh")); }
// TODO: remove implicit conversion (potentially make explicit to start with) //public static implicit operator LegacyGrainId(GrainId id) => LegacyGrainId.FromGrainId(id); /// <summary> /// Creates a new <see cref="GrainType"/> instance. /// </summary> public static GrainId Create(string type, string key) => Create(GrainType.Create(type), key);
/// <summary> /// Creates a new <see cref="GrainType"/> instance. /// </summary> public GrainId(GrainType type, IdSpan key) { Type = type; Key = key; }