Exemple #1
0
 public TextState() : base(NoOp, typeof(string), 1, EmptyTextData, 1, Metadata.NullMetadata())
 {
 }
Exemple #2
0
 public ObjectState() : base(NoOp, typeof(T), 1, EmptyObjectData, 1, Metadata.NullMetadata())
 {
 }
Exemple #3
0
 public TextState(string id, Type type, int typeVersion, string data, int dataVersion, Metadata metadata) : base(id, type, typeVersion, data, dataVersion, metadata)
 {
 }
Exemple #4
0
 public ObjectState(string id, Type type, int typeVersion, T data, int dataVersion, Metadata metadata) : base(id, type, typeVersion, data, dataVersion, metadata)
 {
 }
Exemple #5
0
 public BinaryState() : base(NoOp, typeof(object), 1, EmptyBytesData, 1, Metadata.NullMetadata())
 {
 }
Exemple #6
0
 public BinaryState(string id, Type type, int typeVersion, byte[] data, int dataVersion, Metadata metadata) : base(id, type, typeVersion, data, dataVersion, metadata)
 {
 }
Exemple #7
0
 protected State(string id, Type type, int typeVersion, T data, int dataVersion)
     : this(id, type, typeVersion, data, dataVersion, Metadata.NullMetadata())
 {
 }
Exemple #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();
        }