我在C#以下類環:我怎麼能在種子數據,以便與C#
public partial class Application
{
public Application()
{
this.TestAccounts = new List<TestAccount>();
}
public int ApplicationId { get; set; }
public string Name { get; set; }
public byte[] RowVersion { get; set; }
public System.DateTime ModifiedDate { get; set; }
public virtual ICollection<TestAccount> TestAccounts { get; set; }
}
我想與「AA」,「BB」的應用程序名稱插入一些記錄和使用類似下面的「XX」:
List<Application> applications;
public void seedData() {
var a = new Application { Name = "xx" };
applications.Add(a);
}
有沒有一種方式,我可以附上對於 循環創造了一個新的應用程序記錄的線,並有那麼序列通過並插入三個應用程序,而不是我 編碼他們一個接一個。