From 39aaa49ba517f452b46b6623576f2c7dc602f043 Mon Sep 17 00:00:00 2001 From: hikalkan Date: Fri, 6 Mar 2015 21:45:01 +0200 Subject: [PATCH] Removed seed data backup since it's old. --- src/Abp.Zero.sln | 5 --- src/SeedDataBackup.txt | 72 ------------------------------------------ 2 files changed, 77 deletions(-) delete mode 100644 src/SeedDataBackup.txt diff --git a/src/Abp.Zero.sln b/src/Abp.Zero.sln index 03bc4b93..c2fa8013 100644 --- a/src/Abp.Zero.sln +++ b/src/Abp.Zero.sln @@ -16,11 +16,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{96C4AD .nuget\NuGet.targets = .nuget\NuGet.targets EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Doc", "Doc", "{8633A076-A52A-470B-B941-BD865A80287C}" - ProjectSection(SolutionItems) = preProject - SeedDataBackup.txt = SeedDataBackup.txt - EndProjectSection -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{34AA52E9-B75E-46EF-AEBB-460AED9A0767}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Abp.Zero.SampleApp", "Tests\Abp.Zero.SampleApp\Abp.Zero.SampleApp.csproj", "{59AA0119-F76E-433F-B9D1-385F51A13A17}" diff --git a/src/SeedDataBackup.txt b/src/SeedDataBackup.txt deleted file mode 100644 index 219bc4c8..00000000 --- a/src/SeedDataBackup.txt +++ /dev/null @@ -1,72 +0,0 @@ -//Admin role for tenancy owner - -var adminRoleForTenancyOwner = context.AbpRoles.FirstOrDefault(r => r.TenantId == null && r.Name == "Admin"); -if (adminRoleForTenancyOwner == null) -{ - adminRoleForTenancyOwner = context.AbpRoles.Add(new AbpRole(null, "Admin", "Admin")); - context.SaveChanges(); -} - -//Admin user for tenancy owner - -var adminUserForTenancyOwner = context.AbpUsers.FirstOrDefault(u => u.TenantId == null && u.UserName == "admin"); -if (adminUserForTenancyOwner == null) -{ - adminUserForTenancyOwner = context.AbpUsers.Add( - new AbpUser - { - TenantId = null, - UserName = "admin", - Name = "System", - Surname = "Administrator", - EmailAddress = "admin@aspnetboilerplate.com", - IsEmailConfirmed = true, - Password = "AM4OLBpptxBYmM79lGOX9egzZk3vIQU3d/gFCJzaBjAPXzYIK3tQ2N7X4fcrHtElTw==" //123qwe - }); - - context.SaveChanges(); - - context.UserRoles.Add(new UserRole(adminUserForTenancyOwner.Id, adminRoleForTenancyOwner.Id)); - - context.SaveChanges(); -} - -//Default tenant - -var defaultTenant = context.AbpTenants.FirstOrDefault(t => t.TenancyName == "Default"); -if (defaultTenant == null) -{ - defaultTenant = context.AbpTenants.Add(new AbpTenant("Default", "Default")); - context.SaveChanges(); -} - -//Admin role for 'Default' tenant (above code does not works for this case) - -var adminRoleForDefaultTenant = context.AbpRoles.FirstOrDefault(r => r.TenantId == defaultTenant.Id && r.Name == "Admin"); -if (adminRoleForDefaultTenant == null) -{ - adminRoleForDefaultTenant = context.AbpRoles.Add(new AbpRole(defaultTenant.Id, "Admin", "Admin")); - context.SaveChanges(); -} - -//Admin user for 'Default' tenant (above code does not works for this case) - -var adminUserForDefaultTenant = context.AbpUsers.FirstOrDefault(u => u.TenantId == defaultTenant.Id && u.UserName == "admin"); -if (adminUserForDefaultTenant == null) -{ - adminUserForDefaultTenant = context.AbpUsers.Add( - new AbpUser - { - TenantId = defaultTenant.Id, - UserName = "admin", - Name = "System", - Surname = "Administrator", - EmailAddress = "admin@aspnetboilerplate.com", - IsEmailConfirmed = true, - Password = "AM4OLBpptxBYmM79lGOX9egzZk3vIQU3d/gFCJzaBjAPXzYIK3tQ2N7X4fcrHtElTw==" //123qwe - }); - context.SaveChanges(); - - context.UserRoles.Add(new UserRole(adminUserForDefaultTenant.Id, adminRoleForDefaultTenant.Id)); - context.SaveChanges(); -} \ No newline at end of file