using System.ServiceModel;

using BeWo.Data.Entities;

namespace BeWo.Data
{
    public class LoggedInUserOperationContextExt : IExtension<OperationContext>
    {
        public static LoggedInUserOperationContextExt Current
        {
            get
            {

                if (OperationContext.Current != null)
                    return OperationContext.Current.Extensions.Find<LoggedInUserOperationContextExt>();
                return null;
            }
        }

        public string LoginName { get; set; }

        public string UnhashedPassword { get; set; }

        public ApplicationUser User { get; set; }

        public void Attach(OperationContext owner)
        {
        }

        public void Detach(OperationContext owner)
        {
        }
    }
}