aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Tango.FSE.BL/FSEServiceBase.cs
blob: 8619a1d0c0bf018b77381b9fb9b9376b835c8f42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using Tango.BL.ActionLogs;
using Tango.BL.Entities;
using Tango.Core;
using Tango.Core.DI;
using Tango.FSE.BL.Connectivity;
using Tango.FSE.BL.Web;

namespace Tango.FSE.BL
{
    public abstract class FSEServiceBase : ExtendedObject, IDisposable
    {


        [TangoInject]
        protected IAuthenticationService Authentication { get; set; }

        [TangoInject]
        protected IConnectivityProvider ConnectivityProvider { get; set; }

        [TangoInject]
        protected ICryptographyProvider CryptographyProvider { get; set; }

        [TangoInject]
        protected IActionLogManager ActionLogManager { get; set; }

        [TangoInject]
        protected FSEWebClient WebClient { get; set; }

        protected FSEServicesContainer Services { get; set; }

        protected User CurrentUser
        {
            get { return Authentication.CurrentUser; }
        }

        protected DiskCacheManager DiskCache
        {
            get { return DiskCacheManager.Default; }
        }

        protected MemoryCacheManager MemoryCache
        {
            get { return MemoryCacheManager.Default; }
        }

        public FSEServiceBase()
        {
            TangoIOC.Default.Inject(this);

            TangoIOC.Default.GetInstanceWhenAvailable<FSEServicesContainer>((x) => 
            {
                Services = x;
            });
        }

        public void Dispose()
        {

        }
    }
}