1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-20 12:38:15 -05:00
bitwarden/src/Api/Models/Request/Accounts/UpdateProfileRequestModel.cs
2017-03-08 21:45:08 -05:00

27 lines
749 B
C#

using System.ComponentModel.DataAnnotations;
using Bit.Core.Models.Table;
namespace Bit.Api.Models
{
public class UpdateProfileRequestModel
{
[Required]
[StringLength(50)]
public string Name { get; set; }
[StringLength(50)]
public string MasterPasswordHint { get; set; }
[Required]
[RegularExpression("^[a-z]{2}-[A-Z]{2}$")]
public string Culture { get; set; }
public User ToUser(User existingUser)
{
existingUser.Name = Name;
existingUser.MasterPasswordHint = string.IsNullOrWhiteSpace(MasterPasswordHint) ? null : MasterPasswordHint;
existingUser.Culture = Culture;
return existingUser;
}
}
}