/*
* Copyright (c) Akveo 2019. All Rights Reserved.
* Licensed under the Personal / Commercial License.
* See LICENSE_PERSONAL / LICENSE_COMMERCIAL in the project root for license information on type of purchased license.
*/

using Common.Entities;
using Common.Services.Infrastructure;
using Microsoft.AspNet.Identity;
using System.Web;

namespace Common.WebApi
{
    public class CurrentContextProvider : ICurrentContextProvider
    {
        public ContextSession GetCurrentContext()
        {
            var currentUserId = HttpContext.Current.User.Identity.GetUserId<int>();
            return new ContextSession { UserId = currentUserId };
        }
    }
}
