-
Notifications
You must be signed in to change notification settings - Fork 0
/
Session.cs
35 lines (30 loc) · 1.19 KB
/
Session.cs
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
using ModernRoute.WildData.Core;
using ModernRoute.WildData.Npgsql.Core;
using System;
namespace MeteringDevices.Data
{
class Session : BaseSession, ISession
{
private Lazy<IReadOnlyRepository<Spb.CurrentMeteringValue>> _SpbCurrentMeteringValueRepository;
private Lazy<IReadWriteRepository<Spb.MeteringValue, int>> _SpbMeteringValueRepository;
public Session(string connectionString) : base(connectionString)
{
_SpbCurrentMeteringValueRepository = new Lazy<IReadOnlyRepository<Spb.CurrentMeteringValue>>(CreateReadOnlyRepository<Spb.CurrentMeteringValue>);
_SpbMeteringValueRepository = new Lazy<IReadWriteRepository<Spb.MeteringValue, int>>(CreateReadWriteRepository<Spb.MeteringValue, int>);
}
public IReadOnlyRepository<Spb.CurrentMeteringValue> SpbCurrentMeteringValueRepository
{
get
{
return _SpbCurrentMeteringValueRepository.Value;
}
}
public IReadWriteRepository<Spb.MeteringValue, int> SpbMeteringValueRepository
{
get
{
return _SpbMeteringValueRepository.Value;
}
}
}
}