Почему ниже записано только "{}"?
var myLogin = new TestLogin
{
UserName = "cr@home.com",
Password = "Pass123"
};
Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(myLogin));
public interface ITest;
public class TestLogin : ITest
{
[System.Text.Json.Serialization.JsonPropertyName("userName")]
[Newtonsoft.Json.JsonProperty("userName")]
public string? UserName { get; set; }
[System.Text.Json.Serialization.JsonPropertyName("password")]
[Newtonsoft.Json.JsonProperty("password")]
public string? Password { get; set; }
}
Подробнее здесь: https://stackoverflow.com/questions/786 ... alize-corr
Мобильная версия