Esempio n. 1
0
 public TextState() : base(NoOp, typeof(string), 1, EmptyTextData, 1, Metadata.NullMetadata())
 {
 }
Esempio n. 2
0
 public ObjectState() : base(NoOp, typeof(T), 1, EmptyObjectData, 1, Metadata.NullMetadata())
 {
 }
Esempio n. 3
0
 public TextState(string id, Type type, int typeVersion, string data, int dataVersion, Metadata metadata) : base(id, type, typeVersion, data, dataVersion, metadata)
 {
 }
Esempio n. 4
0
 public ObjectState(string id, Type type, int typeVersion, T data, int dataVersion, Metadata metadata) : base(id, type, typeVersion, data, dataVersion, metadata)
 {
 }
Esempio n. 5
0
 public BinaryState() : base(NoOp, typeof(object), 1, EmptyBytesData, 1, Metadata.NullMetadata())
 {
 }
Esempio n. 6
0
 public BinaryState(string id, Type type, int typeVersion, byte[] data, int dataVersion, Metadata metadata) : base(id, type, typeVersion, data, dataVersion, metadata)
 {
 }
Esempio n. 7
0
 protected State(string id, Type type, int typeVersion, T data, int dataVersion)
     : this(id, type, typeVersion, data, dataVersion, Metadata.NullMetadata())
 {
 }
Esempio n. 8
0
        protected State(string id, Type type, int typeVersion, T data, int dataVersion, Metadata metadata)
        {
            if (id == null)
            {
                throw new ArgumentNullException(nameof(id), "State id must not be null.");
            }
            if (type == null)
            {
                throw new ArgumentNullException(nameof(type), "State type must not be null.");
            }
            if (typeVersion <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(typeVersion), "State typeVersion must be greater than 0.");
            }
            if (data == null)
            {
                throw new ArgumentNullException(nameof(data), "State data must not be null.");
            }
            if (dataVersion <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(dataVersion), "State dataVersion must be greater than 0.");
            }

            Id          = id;
            Type        = type.AssemblyQualifiedName;
            TypeVersion = typeVersion;
            Data        = data;
            DataVersion = dataVersion;
            Metadata    = metadata ?? Metadata.NullMetadata();
        }