Пример #1
0
        public void TestIdFinderSet()
        {
            AnEntity entity = AnEntity.CreateWithIdOnly(10);

            EntityIdFinder.SetIdValueForEntity(entity, 99);
            Object id = EntityIdFinder.GetIdValueFromEntity(entity);

            Assert.That(id, Is.TypeOf(typeof(Int32)));
            Assert.That(id, Is.EqualTo(99));
        }
 public void Save(T obj)
 {
     EntityIdFinder.SetIdValueForEntity(obj);
     context.Add(EntityIdFinder.GetIdValueFromEntity(obj), obj);
 }