コード例 #1
0
 private SetDataOperations(RequestSetData req, IPersistedData prevData, SetDataOperationCode operation, long number)
 {
     this.req       = req;
     this.prevData  = prevData;
     this.operation = operation;
     this.number    = number;
 }
コード例 #2
0
            /// <summary>
            /// Creates an instance of <see cref="SetDataOperations"/> class
            /// </summary>
            /// <param name="prevData">Persisted data object</param>
            /// <param name="req">SetData request</param>
            /// <returns>instance of <see cref="SetDataOperations"/> class</returns>
            public static SetDataOperations TryCreate(IPersistedData prevData, RequestSetData req)
            {
                if (req == null)
                {
                    throw new ArgumentNullException(nameof(req));
                }

                SetDataOperationCode operation;
                long number;

                if (!SetDataOperationHelper.Instance.TryRead(req.Data, out operation, out number))
                {
                    return(null);
                }

                return(new SetDataOperations(req, prevData, operation, number));
            }
コード例 #3
0
ファイル: RequestSetData.cs プロジェクト: Azure/RingMaster
        /// <inheritdoc />
        public override bool DataEquals(IRingMasterBackendRequest obj)
        {
            RequestSetData other = obj as RequestSetData;

            if (this.Version != other?.Version)
            {
                return(false);
            }

            if (this.IsDataCommand != other.IsDataCommand)
            {
                return(false);
            }

            if (!base.DataEquals(other))
            {
                return(false);
            }

            return(EqualityHelper.Equals(this.Data, other.Data));
        }