コード例 #1
0
ファイル: Program.cs プロジェクト: addon365/WebSync
        private static void Initialize(SyncAppContext context)
        {
            if (context.Database.EnsureCreated())
            {
                User[] userEntries = new User[]
                {
                    new User {
                        UserId = Guid.NewGuid(), LoginId = "tamil", UserName = "******", Password = "******"
                    },
                    new User
                    {
                        UserId   = Guid.NewGuid(),
                        LoginId  = "udayan",
                        UserName = "******",
                        Password = "******"
                    }
                };

                context.Users.AddRange(userEntries);
                context.LeadStatuses.AddRange(LeadStatus.GetMasterData());
                context.Users.AddRange(userEntries);
                context.LeadSources.AddRange(LeadSource.GetMasterData());
                Addon365.WebSync.Models.SampleData.PopulateLicenseMachine();
                context.Profiles.AddRange(Addon365.WebSync.Models.SampleData.pro);
                context.Customers.AddRange(Addon365.WebSync.Models.SampleData.cus);
                context.Licenses.AddRange(Addon365.WebSync.Models.SampleData.lic);
                context.LicenseMachines.AddRange(Addon365.WebSync.Models.SampleData.licMac);

                context.SaveChanges();
            }
        }