Код: Выделить всё
int[] hello = new int[3] {1, 2, 3}
Но моя IDE показывает мне ошибку из заголовка.
Код: Выделить всё
Json ola = new Json { {"example1", "value1"}, {"example2", "value2"}};
и этот класс:
Код: Выделить всё
using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace System
{
class Json
{
public Dictionary _dictionary;
public Json()
{
this._dictionary = new Dictionary();
}
public Json(Dictionary dictionary)
{
this._dictionary = dictionary;
}
public void Add(TK key, TV value)
{
this._dictionary.Add(key, value);
}
public IEnumerator GetEnumerator()
{
return this._dictionary.GetEnumerator();
}
public TV this[TK key]
{
get => this._dictionary[key];
set => this._dictionary[key] = value;
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/795 ... lizer-beca