I need to incrementally increase GUID, which I successfully achieved using this
But now, I want to make it through the Increment operator ++ because I want my code to look pretty and concise.
My code:
public class GuidOps
{
public static Guid operator ++(Guid input)
{
return input.Increment(); //Increment works as intended here
}
}
That doesn't work because the type required for the ++ operator must the type of the class where the operator is declared.
Obviously I cannot override declaration of GUID itself
Do you think it is possible to define ++ on GUIDs ?