Skip to content
Snippets Groups Projects
AdaptorUser.cs 1.05 KiB
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using HaaSMiddleware.DomainObjects.Logging;
using HaaSMiddleware.DomainObjects.Notifications;

namespace HaaSMiddleware.DomainObjects.UserAndLimitationManagement {
	[Table("AdaptorUser")]
	public class AdaptorUser : IdentifiableDbEntity, ILogUserIdentification {
		[Required]
		[StringLength(50)]
		public string Username { get; set; }

		[StringLength(50)]
		public string Password { get; set; }

		[Column(TypeName = "text")]
		public string PublicKey { get; set; }

		public bool Synchronize { get; set; }

		public bool Deleted { get; set; }

		public virtual Language Language { get; set; }

		public virtual ICollection<AdaptorUserGroup> Groups { get; set; }

		public virtual ICollection<ResourceLimitation> Limitations { get; set; }

		public string GetLogIdentification() {
			return Username;
		}

		public override string ToString() {
			return String.Format("AdaptorUser: Id={0}, Username={1}", Id, Username);
		}
	}
}