using System.ComponentModel.DataAnnotations;
using API.Entities.Enums;
using API.Entities.Interfaces;
namespace API.Entities
{
    public class ServerSetting : IHasConcurrencyToken
    {
        [Key]
        public ServerSettingKey Key { get; set; }
        /// 
        /// The value of the Setting. Converter knows how to convert to the correct type
        /// 
        public string Value { get; set; }
        /// 
        [ConcurrencyCheck]
        public uint RowVersion { get; private set; }
        /// 
        public void OnSavingChanges()
        {
            RowVersion++;
        }
    }
}