EntityTypeBuilder<TEntity>.HasData Method

Definition

Overloads

HasData(IEnumerable<Object>)

Adds seed data to this entity type. It is used to generate data motion migrations.

HasData(IEnumerable<TEntity>)

Adds seed data to this entity type. It is used to generate data motion migrations.

HasData(Object[])

Adds seed data to this entity type. It is used to generate data motion migrations.

HasData(TEntity[])

Adds seed data to this entity type. It is used to generate data motion migrations.

HasData(IEnumerable<Object>)

Adds seed data to this entity type. It is used to generate data motion migrations.

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.DataBuilder<TEntity> HasData (System.Collections.Generic.IEnumerable<object> data);
override this.HasData : seq<obj> -> Microsoft.EntityFrameworkCore.Metadata.Builders.DataBuilder<'Entity (requires 'Entity : null)>
Public Overridable Function HasData (data As IEnumerable(Of Object)) As DataBuilder(Of TEntity)

Parameters

data
IEnumerable<Object>

A collection of seed data represented by anonymous types.

Returns

An object that can be used to configure the model data.

Applies to

HasData(IEnumerable<TEntity>)

Adds seed data to this entity type. It is used to generate data motion migrations.

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.DataBuilder<TEntity> HasData (System.Collections.Generic.IEnumerable<TEntity> data);
override this.HasData : seq<'Entity (requires 'Entity : null)> -> Microsoft.EntityFrameworkCore.Metadata.Builders.DataBuilder<'Entity (requires 'Entity : null)>
Public Overridable Function HasData (data As IEnumerable(Of TEntity)) As DataBuilder(Of TEntity)

Parameters

data
IEnumerable<TEntity>

A collection of seed data of the same type as the entity.

Returns

An object that can be used to configure the model data.

Applies to

HasData(Object[])

Adds seed data to this entity type. It is used to generate data motion migrations.

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.DataBuilder<TEntity> HasData (params object[] data);
override this.HasData : obj[] -> Microsoft.EntityFrameworkCore.Metadata.Builders.DataBuilder<'Entity (requires 'Entity : null)>
Public Overridable Function HasData (ParamArray data As Object()) As DataBuilder(Of TEntity)

Parameters

data
Object[]

An array of seed data represented by anonymous types.

Returns

An object that can be used to configure the model data.

Applies to

HasData(TEntity[])

Adds seed data to this entity type. It is used to generate data motion migrations.

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.DataBuilder<TEntity> HasData (params TEntity[] data);
override this.HasData : 'Entity[] -> Microsoft.EntityFrameworkCore.Metadata.Builders.DataBuilder<'Entity (requires 'Entity : null)>
Public Overridable Function HasData (ParamArray data As TEntity()) As DataBuilder(Of TEntity)

Parameters

data
TEntity[]

An array of seed data of the same type as the entity.

Returns

An object that can be used to configure the model data.

Applies to