﻿using Microsoft.AspNet.Identity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VagueBook.Infrastructure.Authentication
{
    public abstract class InfrastructureUser<TEntity> : IUser<string>
    {
        public InfrastructureUser(TEntity entity)
        {
            this.Entity = entity;
        }

        public TEntity Entity { get; private set; }

        public abstract string PasswordHash { get; set;  }

        public abstract Guid UserId { get; set; }

        public string UserName
        {
            get
            {
                return this.UserId.ToString().Replace("-", "");
            }
            set
            {
                this.UserId = Guid.Parse(value);
            }
        }

        public string Id
        {
            get
            {
                return this.UserName;
            }
        }
    }
}
