public async Task Insert()
        {
            var newPerson = new Person_SoftUpdatableDbEntity
            {
                Name    = "musa",
                Surname = "demir"
            };


            var insertResult = await _personSoftUpdatableRepo.InsertAsync(newPerson);

            if (insertResult.ID != 0)
            {
                if (await _personSoftUpdatableRepo.AnyAsync(x => x.ID == insertResult.ID))
                {
                    Assert.Pass();
                }
                Assert.Fail("Inserted results id changed but there is no result with returned id. Returned id: " + insertResult.ID);
            }
            Assert.Fail();
        }
Beispiel #2
0
        public async Task Initialize()
        {
            if (await _personSoftUpdatableRepo.AsQueryable().AnyAsync())
            {
                InitializedEntities = await _personSoftUpdatableRepo.AsQueryable().OrderByDescending(x => x.ID).Take(5).Select(x => x.ID).ToListAsync();

                return;
            }

            InitializedEntities = new List <int>();

            for (int i = 0; i < 5; i++)
            {
                var newPerson = new Person_SoftUpdatableDbEntity
                {
                    Name    = "musa" + i,
                    Surname = "demir" + i
                };
                var insertResult = await _personSoftUpdatableRepo.InsertAsync(newPerson);

                InitializedEntities.Add(insertResult.ID);
            }
        }