Ad

I alayws! have to search for this thing and figured it would be a blessing for somebody else out there too!

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

public class Dictionary {

	public static int Upsert() {
    
		Dictionary<string, int> dictionary = new Dictionary<string, int>();
		dictionary["upsert"] = dictionary.GetValueOrDefault("uspert", 0) + 1;

    return dictionary["upsert"];
	}
}