本文整理汇总了C#中EntityTypeConfiguration.ToTable方法的典型用法代码示例。如果您正苦于以下问题:C# EntityTypeConfiguration.ToTable方法的具体用法?C# EntityTypeConfiguration.ToTable怎么用?C# EntityTypeConfiguration.ToTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EntityTypeConfiguration
的用法示例。
在下文中一共展示了EntityTypeConfiguration.ToTable方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Can_get_and_set_table_name
public void Can_get_and_set_table_name()
{
var entityTypeConfiguration = new EntityTypeConfiguration(typeof(object));
entityTypeConfiguration.ToTable("Foo");
Assert.Equal("Foo", entityTypeConfiguration.GetTableName().Name);
}
示例2: RegTo
public void RegTo(ConfigurationRegistrar confRegistrar)
{
var r = new EntityTypeConfiguration<UserInfo>();
r.ToTable("UserInfo");
r.HasKey(p => p.AutoId);
confRegistrar.Add<UserInfo>(r);
}
示例3: MapApiDataSource
/// <summary>Defines the mapping information for the entity 'ApiDataSource'</summary>
/// <param name="config">The configuration to modify.</param>
protected virtual void MapApiDataSource(EntityTypeConfiguration<ApiDataSource> config)
{
config.ToTable("ApiDataSource");
config.HasKey(t => t.Id);
config.Property(t => t.Id).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
config.Property(t => t.SourceName).HasMaxLength(50).IsRequired();
config.Property(t => t.SourceBaseUrl).HasMaxLength(200);
}
示例4: GetTableName_returns_current_TableName
public void GetTableName_returns_current_TableName()
{
var entityTypeConfiguration = new EntityTypeConfiguration(typeof(object));
Assert.Equal(null, entityTypeConfiguration.GetTableName());
entityTypeConfiguration.ToTable("Foo");
Assert.Equal("Foo", entityTypeConfiguration.GetTableName().Name);
}
示例5: MapMovieNotFound
/// <summary>Defines the mapping information for the entity 'MovieNotFound'</summary>
/// <param name="config">The configuration to modify.</param>
protected virtual void MapMovieNotFound(EntityTypeConfiguration<MovieNotFound> config)
{
config.ToTable("MovieNotFound");
config.HasKey(t => new { t.ItemId, t.ItemSource });
config.Property(t => t.ItemId).HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
config.Property(t => t.ItemSource).HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
config.Property(t => t.RowId).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity).IsRequired();
config.Property(t => t.ItemSearchTitle).HasMaxLength(100);
config.Property(t => t.ItemSearchYear);
config.Property(t => t.AddedOn);
config.Property(t => t.ChangedOn);
}
示例6: HandlerInfoConfiguration
private EntityTypeConfiguration<HandlerRecord> HandlerInfoConfiguration()
{
var config = new EntityTypeConfiguration<HandlerRecord>();
config.HasKey(handler => new { handler.MessageId, handler.MessageTypeCode, handler.HandlerTypeCode });
config.Property(handler => handler.MessageId).IsRequired().HasColumnType("char").HasMaxLength(36);
config.Property(handler => handler.MessageTypeCode).IsRequired().HasColumnType("int");
config.Property(handler => handler.HandlerTypeCode).HasColumnType("int");
config.Property(handler => handler.Timestamp).HasColumnName("OnCreated").HasColumnType("datetime");
config.ToTable("thinknet_handlers");
return config;
}
示例7: SnapshotConfiguration
private EntityTypeConfiguration<Snapshot> SnapshotConfiguration()
{
var config = new EntityTypeConfiguration<Snapshot>();
config.HasKey(snapshot => new { snapshot.AggregateRootId, snapshot.AggregateRootTypeCode });
config.Property(snapshot => snapshot.AggregateRootId).IsRequired().HasColumnType("char").HasMaxLength(36);
config.Property(snapshot => snapshot.AggregateRootTypeCode).IsRequired().HasColumnType("int");
config.Property(snapshot => snapshot.Version).HasColumnType("int");
config.Property(snapshot => snapshot.Data).HasColumnType("varchar");
config.Property(snapshot => snapshot.Timestamp).HasColumnName("OnCreated").HasColumnType("datetime");
config.ToTable("thinknet_snapshots");
return config;
}
示例8: EventDataConfiguration
private EntityTypeConfiguration<Event> EventDataConfiguration()
{
var config = new EntityTypeConfiguration<Event>();
config.HasKey(@event => new { @event.AggregateRootId, @event.AggregateRootTypeCode, @event.Version });
config.Property(@event => @event.AggregateRootId).IsRequired().HasColumnType("char").HasMaxLength(36);
config.Property(@event => @event.AggregateRootTypeCode).IsRequired().HasColumnType("int");
config.Property(@event => @event.Version).HasColumnType("int");
config.Property(@event => @event.CorrelationId).HasColumnType("char").HasMaxLength(36);
config.Property(@event => @event.Payload).HasColumnType("varchar");
config.Property(@event => @event.Timestamp).HasColumnName("OnCreated").HasColumnType("datetime");
config.ToTable("thinknet_events");
return config;
}
示例9: MapMovieCreditResult
/// <summary>Defines the mapping information for the entity 'MovieCreditResult'</summary>
/// <param name="config">The configuration to modify.</param>
protected virtual void MapMovieCreditResult(EntityTypeConfiguration<MovieCreditResult> config)
{
config.ToTable("MovieCreditResult");
config.HasKey(t => new { t.ItemId, t.RowId });
config.Property(t => t.ItemId).HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
config.Property(t => t.RowId).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
config.Property(t => t.ItemSearchTitle).HasMaxLength(100);
config.Property(t => t.ApiUrl).HasMaxLength(200);
config.Property(t => t.ResultNum);
config.Property(t => t.Name).HasMaxLength(100);
config.Property(t => t.Order);
config.Property(t => t.CastId).HasColumnName("Cast_Id");
config.Property(t => t.Character).HasMaxLength(100);
config.Property(t => t.CreditId).HasColumnName("Credit_Id").HasMaxLength(50);
config.Property(t => t.TmdId);
config.Property(t => t.ProfilePath).HasColumnName("Profile_Path").HasMaxLength(200);
config.Property(t => t.AddedOn);
config.Property(t => t.ChangedOn);
}
示例10: ToTable_overwrites_existing_name
public void ToTable_overwrites_existing_name()
{
var entityTypeConfiguration = new EntityTypeConfiguration(typeof(object));
entityTypeConfiguration.ToTable("Foo");
entityTypeConfiguration.ToTable("Bar");
Assert.Equal("Bar", entityTypeConfiguration.GetTableName().Name);
}
示例11: SchemaName_returns_current_SchemaName
public void SchemaName_returns_current_SchemaName()
{
var entityTypeConfiguration = new EntityTypeConfiguration(typeof(object));
Assert.Equal(null, entityTypeConfiguration.SchemaName);
entityTypeConfiguration.ToTable("Foo", "Bar");
Assert.Equal("Bar", entityTypeConfiguration.SchemaName);
}
示例12: MapVare
/// <summary>
/// Maps the type <see cref="Reference.Domain.Entities.Vare"/> to the table defined by <seealso cref="TableAttribute.Name"/>.
/// </summary>
protected virtual void MapVare(EntityTypeConfiguration<Vare> config)
{
config.ToTable("Vare");
config.Property(v=>v.Version).IsConcurrencyToken().IsRowVersion();
config.HasKey(e=>e.Id);
}
示例13: MapMovieResult
/// <summary>Defines the mapping information for the entity 'MovieResult'</summary>
/// <param name="config">The configuration to modify.</param>
protected virtual void MapMovieResult(EntityTypeConfiguration<MovieResult> config)
{
config.ToTable("MovieResult");
config.HasKey(t => new { t.ItemId, t.ItemSource, t.RowId });
config.Property(t => t.ItemId).HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
config.Property(t => t.ItemSearchTitle).HasMaxLength(100).IsRequired();
config.Property(t => t.ItemSource).HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
config.Property(t => t.RowId).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
config.Property(t => t.ItemSearchYear);
config.Property(t => t.ApiUrl).HasMaxLength(200);
config.Property(t => t.ResultTitle).HasMaxLength(100);
config.Property(t => t.ResultYear);
config.Property(t => t.IsMovie);
config.Property(t => t.ResultCt);
config.Property(t => t.Page);
config.Property(t => t.TotalPages).HasColumnName("Total_Pages");
config.Property(t => t.TotalResults).HasColumnName("Total_Results");
config.Property(t => t.ResultNum);
config.Property(t => t.GenreIds).HasColumnName("Genre_Ids").HasMaxLength(100);
config.Property(t => t.OriginalLanguage).HasColumnName("Original_Language").HasMaxLength(50);
config.Property(t => t.OriginalTitle).HasColumnName("Original_Title").HasMaxLength(100);
config.Property(t => t.Overview);
config.Property(t => t.ReleaseDate).HasColumnName("Release_Date").HasMaxLength(50);
config.Property(t => t.PosterPath).HasColumnName("Poster_Path").HasMaxLength(250);
config.Property(t => t.Popularity);
config.Property(t => t.Video);
config.Property(t => t.VoteAverage).HasColumnName("Vote_Average");
config.Property(t => t.VoteCount).HasColumnName("Vote_Count");
config.Property(t => t.Rated).HasMaxLength(50);
config.Property(t => t.Released).HasMaxLength(50);
config.Property(t => t.Runtime).HasMaxLength(50);
config.Property(t => t.Genre).HasMaxLength(50);
config.Property(t => t.Director).HasMaxLength(100);
config.Property(t => t.Writer).HasMaxLength(100);
config.Property(t => t.Actors);
config.Property(t => t.Plot);
config.Property(t => t.Language).HasMaxLength(50);
config.Property(t => t.Country).HasMaxLength(50);
config.Property(t => t.Awards).HasMaxLength(100);
config.Property(t => t.Poster).HasMaxLength(200);
config.Property(t => t.MetaScore).HasMaxLength(50);
config.Property(t => t.ImdbRating).HasMaxLength(50);
config.Property(t => t.ImdbVotes).HasMaxLength(50);
config.Property(t => t.ImdbId).HasMaxLength(50);
config.Property(t => t.Type).HasMaxLength(100);
config.Property(t => t.Tmeter).HasColumnName("TMeter").HasMaxLength(100);
config.Property(t => t.Timage).HasColumnName("TImage").HasMaxLength(200);
config.Property(t => t.Trating).HasColumnName("TRating").HasMaxLength(50);
config.Property(t => t.Treviews).HasColumnName("TReviews");
config.Property(t => t.Tfresh).HasColumnName("TFresh").HasMaxLength(50);
config.Property(t => t.Trotten).HasColumnName("TRotten").HasMaxLength(50);
config.Property(t => t.Tconsensus).HasColumnName("TConsensus").HasMaxLength(50);
config.Property(t => t.TuserMeter).HasColumnName("TUserMeter").HasMaxLength(50);
config.Property(t => t.TuserRating).HasColumnName("TUserRating").HasMaxLength(50);
config.Property(t => t.TuserReviews).HasColumnName("TUserReviews");
config.Property(t => t.Dvd).HasColumnName("DVD").HasMaxLength(100);
config.Property(t => t.BoxOffice).HasMaxLength(50);
config.Property(t => t.Production).HasMaxLength(50);
config.Property(t => t.Website).HasMaxLength(200);
config.Property(t => t.Response).HasMaxLength(10);
config.Property(t => t.AddedOn);
config.Property(t => t.ChangedOn);
}