public static NamedId <DomainId> NamedId(this ISchemaEntity schema) { return(StaticNamedId.Of(schema.Id, schema.SchemaDef.Name)); }
public static NamedId <long> NamedId(this IField field) { return(NamedIdStatic.Of(field.Id, field.Name)); }
public void Should_serialize_and_deserialize_valid_guid_token() { var value = new NamedId <Guid>(Guid.NewGuid(), "my-name"); value.SerializeAndDeserialize(new NamedGuidIdConverter()); }
public static DomainId Combine(NamedId <DomainId> id1, DomainId id2) { return(new DomainId($"{id1.Id}--{id2}")); }
public void Should_serialize_and_deserialize_null_guid_token() { NamedId <Guid> value = null; value.SerializeAndDeserialize(new NamedGuidIdConverter()); }
public void Should_serialize_and_deserialize_valid_string_token() { var value = new NamedId <string>(Guid.NewGuid().ToString(), "my-name"); value.SerializeAndDeserialize(new NamedStringIdConverter()); }
public void Should_serialize_and_deserialize_null_string_token() { NamedId <string> value = null; value.SerializeAndDeserialize(new NamedStringIdConverter()); }
public void Should_serialize_and_deserialize_valid_long_token() { var value = new NamedId <long>(123, "my-name"); value.SerializeAndDeserialize(new NamedLongIdConverter()); }
public bool Equals(NamedId <T> other) { return(other != null && (ReferenceEquals(this, other) || (Id.Equals(other.Id) && Name.Equals(other.Name)))); }