Пример #1
0
        public TrackableTestPocoWithCustomId Clone()
        {
            var o = new TrackableTestPocoWithCustomId();

            o._CustomId = _CustomId;
            o._Name     = _Name;
            o._Age      = _Age;
            o._Extra    = _Extra;
            return(o);
        }
Пример #2
0
        public async Task Test_MongoDbMapperWithCustomKey_CreateAndLoadPoco()
        {
            var person = new TrackableTestPocoWithCustomId
            {
                CustomId = UniqueInt64Id.GenerateNewId(),
                Name     = "Testor",
                Age      = 25
            };
            await _mapper.CreateAsync(_collection, person);

            var person2 = await _mapper.LoadAsync(_collection, person.CustomId);

            Assert.Equal(person.CustomId, person2.CustomId);
            Assert.Equal(person.Name, person2.Name);
            Assert.Equal(person.Age, person2.Age);
        }