コード例 #1
0
        private static Mock<InternalEntityEntry> CreateInternalEntryMock(Property property)
        {
            var entityTypeMock = new Mock<EntityType>("Entity", new Model(), ConfigurationSource.Explicit);
            entityTypeMock.Setup(e => e.GetProperties()).Returns(new[] { property });

            entityTypeMock.Setup(e => e.Counts).Returns(new PropertyCounts(0, 0, 0, 0, 0, 0));

            var internalEntryMock = new Mock<InternalEntityEntry>(
                Mock.Of<IStateManager>(), entityTypeMock.Object);
            return internalEntryMock;
        }
コード例 #2
0
 /// <summary>
 ///     This is an internal API that supports the Entity Framework Core infrastructure and not subject to
 ///     the same compatibility standards as public APIs. It may be changed or removed without notice in
 ///     any release. You should only use it directly in your code with extreme caution and knowing that
 ///     doing so can result in application failures when updating to a new Entity Framework Core release.
 /// </summary>
 public static string ToDebugString(
     this Property property,
     MetadataDebugStringOptions options = MetadataDebugStringOptions.ShortDefault,
     int indent = 0)
 => ((IReadOnlyProperty)property).ToDebugString(options, indent);
コード例 #3
0
 /// <summary>
 ///     This is an internal API that supports the Entity Framework Core infrastructure and not subject to
 ///     the same compatibility standards as public APIs. It may be changed or removed without notice in
 ///     any release. You should only use it directly in your code with extreme caution and knowing that
 ///     doing so can result in application failures when updating to a new Entity Framework Core release.
 /// </summary>
 public static bool IsKey(this Property property)
 => property.Keys != null;