コード例 #1
0
        public async Task Test_SaveAndLoad_CheckIgnored()
        {
            var id = 2;
            var c0 = new TrackableTestContainerWithIgnore();
            await _mapper.CreateAsync(_db.Connection, c0, id);

            ((ITrackable)c0).SetDefaultTracker();
            c0.Person.Name = "Testor";
            c0.Person.Age  = 10;
            c0.Missions[1] = new MissionData {
                Kind = 101, Count = 20, Note = "Ignored"
            };
            await _mapper.SaveAsync(_db.Connection, c0.Tracker, id);

            var c1 = await _mapper.LoadAsync(_db.Connection, id);

            Assert.NotNull(c1.Person);
            Assert.Equal(c0.Person.Name, c1.Person.Name);
            Assert.Equal(c0.Person.Age, c1.Person.Age);
            Assert.Equal(0, c1.Missions.Count);
        }
コード例 #2
0
ファイル: SqlDriver.cs プロジェクト: tteogi/TrackableData
 public Task SaveUserAsync(int uid, TrackableUserTracker tracker)
 {
     return(_userMapper.SaveAsync(_connection, tracker, uid));
 }
コード例 #3
0
 protected override Task SaveAsync(TrackableTestContainer container)
 {
     return(_mapper.SaveAsync(_db.Connection, container.Tracker, _testId));
 }