Пример #1
0
        public virtual void Passes_on_shadow_primary_key_created_by_convention_in_dependent_type()
        {
            var model       = (IConventionModel)CreateConventionlessModelBuilder().Model;
            var entityType  = model.AddEntityType(typeof(A));
            var keyProperty = entityType.AddProperty("Key", typeof(int));

            entityType.SetPrimaryKey(keyProperty);

            VerifyWarning(CoreResources.LogShadowPropertyCreated(new TestLogger <LoggingDefinitions>()).GenerateMessage("Key", "A"), model, LogLevel.Debug);
        }
Пример #2
0
        public virtual void Passes_on_shadow_key_created_explicitly()
        {
            var model = CreateConventionlessModelBuilder().Model;

            var entityType = model.AddEntityType(typeof(A));

            SetPrimaryKey(entityType);
            AddProperties(entityType);

            var keyProperty = entityType.AddProperty("Key", typeof(int));

            entityType.AddKey(keyProperty);

            VerifyWarning(CoreResources.LogShadowPropertyCreated(new TestLogger <TestLoggingDefinitions>()).GenerateMessage("Key", "A"), model, LogLevel.Debug);
        }