using System.Collections.Generic;
public static void Main()
Console.WriteLine("Hello World " + GroupedProperty.FromString("cat:prop"));
var dic1 = new Dictionary<GroupedProperty, string>();
var dic2 = new Dictionary<string, string>();
private static void Dump<T>(T value)
Console.WriteLine(JsonConvert.SerializeObject(value, Formatting.Indented));
Console.WriteLine(JsonConvert.SerializeObject(JsonConvert.DeserializeObject(JsonConvert.SerializeObject(value, Formatting.Indented)), Formatting.Indented));
public class GroupedProperty
public string PropertyName
public static GroupedProperty FromString(string value)
var values = value.Split(new[]{':'}, 2);
return new GroupedProperty{GroupName = values[0], PropertyName = values[1]};
return new GroupedProperty{GroupName = "", PropertyName = values[0]};
public static implicit operator string (GroupedProperty value) => value.ToString();
public static implicit operator GroupedProperty(string value) => FromString(value);
public override string ToString() => $"{GroupName}:{PropertyName}";
public override int GetHashCode() => ToString().GetHashCode();
public override bool Equals(object obj)
if (obj is GroupedProperty value)
return ToString() == value.ToString();