i have this model
public class AppInfo
{
[Required(ErrorMessage = "Campo obrigatório")]
[NonEditable]
public string nick { get; set; }
[Required(ErrorMessage = "Campo obrigatório")]
[NonEditable]
public string version { get; set; }
public string description { get; set; }
public bool invalidated { get; set; }
public System.DateTime releasedAt { get; set; }
public System.DateTime createdAt { get; set; }
public System.DateTime updatedAt { get; set; }
}
and i want to create a NonEditable attribute for a PATCH request, what can i do inside the Attribute to do what i want ? I have no ideia what to do
Attribute class:
[AttributeUsage(AttributeTargets.All)]
public class NonEditableAttribute : Attribute
{
private string name;
private string action;
public NonEditableAttribute([CallerMemberName] string name = null)
{
this.name = name;
}
}
}