/// <inheritdoc />
 public bool Equals(SyncGroupRequest other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(base.Equals(other) &&
            group_assignments.HasEqualElementsInOrder(other.group_assignments));
 }
示例#2
0
        private static byte[] EncodeRequest(IRequestContext context, SyncGroupRequest request)
        {
            using (var writer = EncodeHeader(context, request)) {
                writer.Write(request.GroupId)
                .Write(request.GroupGenerationId)
                .Write(request.MemberId)
                .Write(request.GroupAssignments.Count);

                var encoder = context.GetEncoder();
                foreach (var assignment in request.GroupAssignments)
                {
                    writer.Write(assignment.MemberId)
                    .Write(assignment.MemberAssignment, encoder);
                }

                return(writer.ToBytes());
            }
        }