public void CreateEntityTypeDataWithFactory() { // Arrange & Act IEntityTypeData <Country> entityTypeData = EntityTypeDataFactory.GetEntityTypeData <Country>(); // Assert Assert.NotNull(entityTypeData); // Check name changes Assert.NotNull(entityTypeData.NameChanges); Assert.True(entityTypeData.NameChanges.ContainsKey("Continent")); Assert.Equal(entityTypeData.NameChanges["Continent"], "PartitionKey"); Assert.True(entityTypeData.NameChanges.ContainsKey("Continent")); Assert.Equal(entityTypeData.NameChanges["Name"], "RowKey"); }
public static void HasData <T>(this ModelBuilder modelBuilder, IEntityTypeData <T> config) where T : class => config.HasData(modelBuilder.Entity <T>());
/// <summary> /// Constructor. /// </summary> public TableEntityConverter() { _typeData = EntityTypeDataFactory.GetEntityTypeData <T>(); }
/// <summary> /// Registers an entity type data. /// </summary> /// <typeparam name="T">Entity type.</typeparam> /// <param name="entityTypeData">Entity type data.</param> public static void RegisterEntityTypeData <T>(IEntityTypeData <T> entityTypeData) where T : class, new() { TypesData.GetOrAdd(typeof(T), type => entityTypeData); }