SocialPub/PrivaPub.ClientModels/User/Avatar/InsertAvatarForm.cs
2023-02-19 00:43:43 +01:00

36 lines
1.6 KiB
C#

using PrivaPub.ClientModels.Resources;
using System.ComponentModel.DataAnnotations;
using System.Security.AccessControl;
using System.Text.Json.Serialization;
using System.Xml.Linq;
namespace PrivaPub.ClientModels.User.Avatar
{
[JsonSerializable(typeof(InsertAvatarForm))]
public class InsertAvatarForm
{
[JsonIgnore]
public string RootId { get; set; }
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
StringLength(Constants.MaxAvatarNameLength, ErrorMessageResourceName = "StringLength", ErrorMessageResourceType = typeof(ErrorsResource)),
Display(Name = nameof(Name), ResourceType = typeof(FieldsNameResource))]
public string Name { get; set; }//name
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
StringLength(Constants.MaxAvatarNameLength, ErrorMessageResourceName = "StringLength", ErrorMessageResourceType = typeof(ErrorsResource)),
Display(Name = nameof(UserName), ResourceType = typeof(FieldsNameResource))]
public string UserName { get; set; }//preferredUsername
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
StringLength(Constants.MaxAvatarBiographyLength, ErrorMessageResourceName = "StringLength", ErrorMessageResourceType = typeof(ErrorsResource)),
Display(Name = nameof(Biography), ResourceType = typeof(FieldsNameResource))]
public string Biography { get; set; }//summary
public ViewAvatarSettings Settings { get; set; } = new();
public Dictionary<string, string> Fields { get; set; } = new();
public string PersonalNote { get; set; }
}
}