示例#1
0
 public bool Equals(FieldDto otherFieldDto)
 {
     if (ReferenceEquals(null, otherFieldDto)) return false;
     if (ReferenceEquals(this, otherFieldDto)) return true;
     return otherFieldDto.Id.Equals(Id)
         && Equals(otherFieldDto.Name, Name)
         && Equals(otherFieldDto.FieldTypeKey, FieldTypeKey)
         && Equals(otherFieldDto.Value, Value)
         && Properties.SequenceEqual(otherFieldDto.Properties);
 }
示例#2
0
 public bool Equals(FieldDto otherFieldDto)
 {
     if (ReferenceEquals(null, otherFieldDto))
     {
         return(false);
     }
     if (ReferenceEquals(this, otherFieldDto))
     {
         return(true);
     }
     return(otherFieldDto.Id.Equals(Id) &&
            Equals(otherFieldDto.Name, Name) &&
            Equals(otherFieldDto.FieldTypeKey, FieldTypeKey) &&
            Equals(otherFieldDto.Value, Value) &&
            Properties.SequenceEqual(otherFieldDto.Properties));
 }
示例#3
0
        internal void Update(AccountDto accountDto)
        {
            if (accountDto.Id != Id) {
                throw new Exception("Cannot update a different DTO, ID don't match");
            };
            accountDto.Fields.Clear();
            foreach (var field in Fields) {
                var fieldDto = new FieldDto {
                    Id = field.Id,
                    FieldTypeKey = field.FieldType.Key.ToString(),
                    Name = field.Name,
                    Value = field.Value
                };
                accountDto.Fields.Add(fieldDto);
            }

            accountDto.Tags.Clear();
            foreach (var tag in Tags) {
                accountDto.Tags.Add(new TagDto {
                    Key = tag.Key
                });
            }
            accountDto.Notes = Notes;
        }