Ejemplo n.º 1
0
 /// <summary>
 /// Creates a new <see cref="GrainType"/> instance.
 /// </summary>
 public static GrainId Create(GrainType type, string key) => new(type, IdSpan.Create(key));
Ejemplo n.º 2
0
 /// <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"));
 }
Ejemplo n.º 3
0
        // 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);
Ejemplo n.º 4
0
 /// <summary>
 /// Creates a new <see cref="GrainType"/> instance.
 /// </summary>
 public GrainId(GrainType type, IdSpan key)
 {
     Type = type;
     Key  = key;
 }