Пример #1
0
 public static NamedId <DomainId> NamedId(this ISchemaEntity schema)
 {
     return(StaticNamedId.Of(schema.Id, schema.SchemaDef.Name));
 }
Пример #2
0
 public static NamedId <long> NamedId(this IField field)
 {
     return(NamedIdStatic.Of(field.Id, field.Name));
 }
Пример #3
0
        public void Should_serialize_and_deserialize_valid_guid_token()
        {
            var value = new NamedId <Guid>(Guid.NewGuid(), "my-name");

            value.SerializeAndDeserialize(new NamedGuidIdConverter());
        }
Пример #4
0
 public static DomainId Combine(NamedId <DomainId> id1, DomainId id2)
 {
     return(new DomainId($"{id1.Id}--{id2}"));
 }
Пример #5
0
        public void Should_serialize_and_deserialize_null_guid_token()
        {
            NamedId <Guid> value = null;

            value.SerializeAndDeserialize(new NamedGuidIdConverter());
        }
Пример #6
0
        public void Should_serialize_and_deserialize_valid_string_token()
        {
            var value = new NamedId <string>(Guid.NewGuid().ToString(), "my-name");

            value.SerializeAndDeserialize(new NamedStringIdConverter());
        }
Пример #7
0
        public void Should_serialize_and_deserialize_null_string_token()
        {
            NamedId <string> value = null;

            value.SerializeAndDeserialize(new NamedStringIdConverter());
        }
Пример #8
0
        public void Should_serialize_and_deserialize_valid_long_token()
        {
            var value = new NamedId <long>(123, "my-name");

            value.SerializeAndDeserialize(new NamedLongIdConverter());
        }
Пример #9
0
 public bool Equals(NamedId <T> other)
 {
     return(other != null && (ReferenceEquals(this, other) || (Id.Equals(other.Id) && Name.Equals(other.Name))));
 }