Dapper.Contrib
Dapper.Contrib copied to clipboard
Does internal type property ignored?
I have and internal type property called code in my class to ignore it in JSON serialization in my API.
But this is ignored in insert/update as well by Dapper and the insert query throw error while the select works fine. Is there any setting I can use in Dapper to map internal types?
public class User
{
public int id {get; set;}
public string name {get; set;}
internal string code {get; set;}
}
or any other types like which is mapped in select, insert and update while can be ignored by JSON serialization.
@vickyRathee You can add the [JsonIgnore] attribute to the property and then make it public.