Browse Source

Remove EventHubSeedData and refactor EventHubDataSeedContributor

pull/29/head
Halil İbrahim Kalkan 6 years ago
parent
commit
b9f7870922
  1. 504
      src/EventHub.Domain/EventHubDataSeedContributor.cs
  2. 24
      src/EventHub.Domain/EventHubSeedData.cs

504
src/EventHub.Domain/EventHubDataSeedContributor.cs

@ -6,11 +6,13 @@ using EventHub.Events;
using EventHub.Events.Registrations;
using EventHub.Organizations;
using EventHub.Users;
using Microsoft.AspNetCore.Identity;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Guids;
using Volo.Abp.Identity;
using IdentityUser = Volo.Abp.Identity.IdentityUser;
namespace EventHub
{
@ -18,7 +20,6 @@ namespace EventHub
{
private readonly IGuidGenerator _guidGenerator;
private readonly IdentityUserManager _identityUserManager;
private readonly EventHubSeedData _eventHubSeedData;
private readonly IRepository<Organization, Guid> _organizationRepository;
private readonly IRepository<Event, Guid> _eventRepository;
private readonly EventManager _eventManager;
@ -26,10 +27,22 @@ namespace EventHub
private readonly IRepository<AppUser, Guid> _userRepository;
private readonly IRepository<Country, Guid> _countryRepository;
private Guid _userSandraId;
private Guid _userSergeyId;
private Guid _userWellyId;
private Guid _userAlessandroId;
private Guid _userMarkId;
private Guid _userTonyId;
private Guid _organizationVolosoftId;
private Guid _organizationAbpId;
private Guid _organizationAngularCoderId;
private Guid _organizationDotnetWorldId;
private Guid _organizationDeveloperDaysId;
private Guid _organizationCSharpLoversId;
public EventHubDataSeedContributor(
IGuidGenerator guidGenerator,
IdentityUserManager identityUserManager,
EventHubSeedData eventHubSeedData,
IRepository<Organization, Guid> organizationRepository,
IRepository<Event, Guid> eventRepository,
EventManager eventManager,
@ -39,7 +52,6 @@ namespace EventHub
{
_guidGenerator = guidGenerator;
_identityUserManager = identityUserManager;
_eventHubSeedData = eventHubSeedData;
_organizationRepository = organizationRepository;
_eventRepository = eventRepository;
_eventManager = eventManager;
@ -47,32 +59,238 @@ namespace EventHub
_userRepository = userRepository;
_countryRepository = countryRepository;
}
private async Task CreateCountriesAsync()
{
if (await _countryRepository.GetCountAsync() > 0)
{
return;
}
var countries = new List<Country>
{
new Country(Guid.NewGuid(), "Afghanistan"),
new Country(Guid.NewGuid(), "Albania"),
new Country(Guid.NewGuid(), "Algeria"),
new Country(Guid.NewGuid(), "Andorra"),
new Country(Guid.NewGuid(), "Angola"),
new Country(Guid.NewGuid(), "Antigua and Barbuda"),
new Country(Guid.NewGuid(), "Argentina"),
new Country(Guid.NewGuid(), "Armenia"),
new Country(Guid.NewGuid(), "Australia"),
new Country(Guid.NewGuid(), "Austria"),
new Country(Guid.NewGuid(), "Azerbaijan"),
new Country(Guid.NewGuid(), "Bahamas"),
new Country(Guid.NewGuid(), "Bahrain"),
new Country(Guid.NewGuid(), "Bangladesh"),
new Country(Guid.NewGuid(), "Barbados"),
new Country(Guid.NewGuid(), "Belarus"),
new Country(Guid.NewGuid(), "Belgium"),
new Country(Guid.NewGuid(), "Belize"),
new Country(Guid.NewGuid(), "Benin"),
new Country(Guid.NewGuid(), "Bhutan"),
new Country(Guid.NewGuid(), "Bolivia"),
new Country(Guid.NewGuid(), "Bosnia and Herzegovina"),
new Country(Guid.NewGuid(), "Botswana"),
new Country(Guid.NewGuid(), "Brazil"),
new Country(Guid.NewGuid(), "Brunei"),
new Country(Guid.NewGuid(), "Bulgaria"),
new Country(Guid.NewGuid(), "Burkina Faso"),
new Country(Guid.NewGuid(), "Burundi"),
new Country(Guid.NewGuid(), "Côte d'Ivoire"),
new Country(Guid.NewGuid(), "Cabo Verde"),
new Country(Guid.NewGuid(), "Cambodia"),
new Country(Guid.NewGuid(), "Cameroon"),
new Country(Guid.NewGuid(), "Canada"),
new Country(Guid.NewGuid(), "Central African Republic"),
new Country(Guid.NewGuid(), "Chad"),
new Country(Guid.NewGuid(), "Chile"),
new Country(Guid.NewGuid(), "China"),
new Country(Guid.NewGuid(), "Colombia"),
new Country(Guid.NewGuid(), "Comoros"),
new Country(Guid.NewGuid(), "Congo (Congo-Brazzaville)"),
new Country(Guid.NewGuid(), "Costa Rica"),
new Country(Guid.NewGuid(), "Croatia"),
new Country(Guid.NewGuid(), "Cuba"),
new Country(Guid.NewGuid(), "Cyprus"),
new Country(Guid.NewGuid(), "Czechia (Czech Republic)"),
new Country(Guid.NewGuid(), "Democratic Republic of the Congo"),
new Country(Guid.NewGuid(), "Denmark"),
new Country(Guid.NewGuid(), "Djibouti"),
new Country(Guid.NewGuid(), "Dominica"),
new Country(Guid.NewGuid(), "Dominican Republic"),
new Country(Guid.NewGuid(), "Ecuador"),
new Country(Guid.NewGuid(), "Egypt"),
new Country(Guid.NewGuid(), "El Salvador"),
new Country(Guid.NewGuid(), "Equatorial Guinea"),
new Country(Guid.NewGuid(), "Eritrea"),
new Country(Guid.NewGuid(), "Estonia"),
new Country(Guid.NewGuid(), "Eswatini (formerly Swaziland)"),
new Country(Guid.NewGuid(), "Ethiopia"),
new Country(Guid.NewGuid(), "Fiji"),
new Country(Guid.NewGuid(), "Finland"),
new Country(Guid.NewGuid(), "France"),
new Country(Guid.NewGuid(), "Gabon"),
new Country(Guid.NewGuid(), "Gambia"),
new Country(Guid.NewGuid(), "Georgia"),
new Country(Guid.NewGuid(), "Germany"),
new Country(Guid.NewGuid(), "Ghana"),
new Country(Guid.NewGuid(), "Greece"),
new Country(Guid.NewGuid(), "Grenada"),
new Country(Guid.NewGuid(), "Guatemala"),
new Country(Guid.NewGuid(), "Guinea"),
new Country(Guid.NewGuid(), "Guinea-Bissau"),
new Country(Guid.NewGuid(), "Guyana"),
new Country(Guid.NewGuid(), "Haiti"),
new Country(Guid.NewGuid(), "Holy See"),
new Country(Guid.NewGuid(), "Honduras"),
new Country(Guid.NewGuid(), "Hungary"),
new Country(Guid.NewGuid(), "Iceland"),
new Country(Guid.NewGuid(), "India"),
new Country(Guid.NewGuid(), "Indonesia"),
new Country(Guid.NewGuid(), "Iran"),
new Country(Guid.NewGuid(), "Iraq"),
new Country(Guid.NewGuid(), "Ireland"),
new Country(Guid.NewGuid(), "Israel"),
new Country(Guid.NewGuid(), "Italy"),
new Country(Guid.NewGuid(), "Jamaica"),
new Country(Guid.NewGuid(), "Japan"),
new Country(Guid.NewGuid(), "Jordan"),
new Country(Guid.NewGuid(), "Kazakhstan"),
new Country(Guid.NewGuid(), "Kenya"),
new Country(Guid.NewGuid(), "Kiribati"),
new Country(Guid.NewGuid(), "Kuwait"),
new Country(Guid.NewGuid(), "Kyrgyzstan"),
new Country(Guid.NewGuid(), "Laos"),
new Country(Guid.NewGuid(), "Latvia"),
new Country(Guid.NewGuid(), "Lebanon"),
new Country(Guid.NewGuid(), "Lesotho"),
new Country(Guid.NewGuid(), "Liberia"),
new Country(Guid.NewGuid(), "Libya"),
new Country(Guid.NewGuid(), "Liechtenstein"),
new Country(Guid.NewGuid(), "Lithuania"),
new Country(Guid.NewGuid(), "Luxembourg"),
new Country(Guid.NewGuid(), "Madagascar"),
new Country(Guid.NewGuid(), "Malawi"),
new Country(Guid.NewGuid(), "Malaysia"),
new Country(Guid.NewGuid(), "Maldives"),
new Country(Guid.NewGuid(), "Mali"),
new Country(Guid.NewGuid(), "Malta"),
new Country(Guid.NewGuid(), "Marshall Islands"),
new Country(Guid.NewGuid(), "Mauritania"),
new Country(Guid.NewGuid(), "Mauritius"),
new Country(Guid.NewGuid(), "Mexico"),
new Country(Guid.NewGuid(), "Micronesia"),
new Country(Guid.NewGuid(), "Moldova"),
new Country(Guid.NewGuid(), "Monaco"),
new Country(Guid.NewGuid(), "Mongolia"),
new Country(Guid.NewGuid(), "Montenegro"),
new Country(Guid.NewGuid(), "Morocco"),
new Country(Guid.NewGuid(), "Mozambique"),
new Country(Guid.NewGuid(), "Myanmar (formerly Burma)"),
new Country(Guid.NewGuid(), "Namibia"),
new Country(Guid.NewGuid(), "Nauru"),
new Country(Guid.NewGuid(), "Nepal"),
new Country(Guid.NewGuid(), "Netherlands"),
new Country(Guid.NewGuid(), "New Zealand"),
new Country(Guid.NewGuid(), "Nicaragua"),
new Country(Guid.NewGuid(), "Niger"),
new Country(Guid.NewGuid(), "Nigeria"),
new Country(Guid.NewGuid(), "North Korea"),
new Country(Guid.NewGuid(), "North Macedonia"),
new Country(Guid.NewGuid(), "Norway"),
new Country(Guid.NewGuid(), "Oman"),
new Country(Guid.NewGuid(), "Pakistan"),
new Country(Guid.NewGuid(), "Palau"),
new Country(Guid.NewGuid(), "Palestine State"),
new Country(Guid.NewGuid(), "Panama"),
new Country(Guid.NewGuid(), "Papua New Guinea"),
new Country(Guid.NewGuid(), "Paraguay"),
new Country(Guid.NewGuid(), "Peru"),
new Country(Guid.NewGuid(), "Philippines"),
new Country(Guid.NewGuid(), "Poland"),
new Country(Guid.NewGuid(), "Portugal"),
new Country(Guid.NewGuid(), "Qatar"),
new Country(Guid.NewGuid(), "Romania"),
new Country(Guid.NewGuid(), "Russia"),
new Country(Guid.NewGuid(), "Rwanda"),
new Country(Guid.NewGuid(), "Saint Kitts and Nevis"),
new Country(Guid.NewGuid(), "Saint Lucia"),
new Country(Guid.NewGuid(), "Saint Vincent and the Grenadines"),
new Country(Guid.NewGuid(), "Samoa"),
new Country(Guid.NewGuid(), "San Marino"),
new Country(Guid.NewGuid(), "Sao Tome and Principe"),
new Country(Guid.NewGuid(), "Saudi Arabia"),
new Country(Guid.NewGuid(), "Senegal"),
new Country(Guid.NewGuid(), "Serbia"),
new Country(Guid.NewGuid(), "Seychelles"),
new Country(Guid.NewGuid(), "Sierra Leone"),
new Country(Guid.NewGuid(), "Singapore"),
new Country(Guid.NewGuid(), "Slovakia"),
new Country(Guid.NewGuid(), "Slovenia"),
new Country(Guid.NewGuid(), "Solomon Islands"),
new Country(Guid.NewGuid(), "Somalia"),
new Country(Guid.NewGuid(), "South Africa"),
new Country(Guid.NewGuid(), "South Korea"),
new Country(Guid.NewGuid(), "South Sudan"),
new Country(Guid.NewGuid(), "Spain"),
new Country(Guid.NewGuid(), "Sri Lanka"),
new Country(Guid.NewGuid(), "Sudan"),
new Country(Guid.NewGuid(), "Suriname"),
new Country(Guid.NewGuid(), "Sweden"),
new Country(Guid.NewGuid(), "Switzerland"),
new Country(Guid.NewGuid(), "Syria"),
new Country(Guid.NewGuid(), "Tajikistan"),
new Country(Guid.NewGuid(), "Tanzania"),
new Country(Guid.NewGuid(), "Thailand"),
new Country(Guid.NewGuid(), "Timor-Leste"),
new Country(Guid.NewGuid(), "Togo"),
new Country(Guid.NewGuid(), "Tonga"),
new Country(Guid.NewGuid(), "Trinidad and Tobago"),
new Country(Guid.NewGuid(), "Tunisia"),
new Country(Guid.NewGuid(), "Turkey"),
new Country(Guid.NewGuid(), "Turkmenistan"),
new Country(Guid.NewGuid(), "Tuvalu"),
new Country(Guid.NewGuid(), "Uganda"),
new Country(Guid.NewGuid(), "Ukraine"),
new Country(Guid.NewGuid(), "United Arab Emirates"),
new Country(Guid.NewGuid(), "United Kingdom"),
new Country(Guid.NewGuid(), "United States of America"),
new Country(Guid.NewGuid(), "Uruguay"),
new Country(Guid.NewGuid(), "Uzbekistan"),
new Country(Guid.NewGuid(), "Vanuatu"),
new Country(Guid.NewGuid(), "Venezuela"),
new Country(Guid.NewGuid(), "Vietnam"),
new Country(Guid.NewGuid(), "Yemen"),
new Country(Guid.NewGuid(), "Zambia"),
new Country(Guid.NewGuid(), "Zimbabwe")
};
await _countryRepository.InsertManyAsync(countries, autoSave: true);
}
public async Task SeedAsync(DataSeedContext context)
{
await CreateCountriesAsync();
#if DEBUG
await SeedUsersAsync();
await SeedOrganizationsAsync();
await SeedEventsAsync();
if (await _userRepository.GetCountAsync() <= 1)
{
await CreateSampleUsersAsync();
await CreateSampleOrganizationsAsync();
await CreateSampleEventsAsync();
}
#endif
await SeedCountriesAsync();
}
private async Task SeedUsersAsync()
private async Task CreateSampleUsersAsync()
{
if (await _userRepository.GetCountAsync() > 1)
{
return;
}
var users = new List<IdentityUser>
{
new IdentityUser(_eventHubSeedData.UserSandraId, "SandraWolf", "sandra_wolf@gmail.com"),
new IdentityUser(_eventHubSeedData.UserSergeyId, "SergeyPolgul", "sergey_polgul@gmail.com"),
new IdentityUser(_eventHubSeedData.UserWellyId, "WellyTambunan", "welly_tambunan@gmail.com"),
new IdentityUser(_eventHubSeedData.UserAlessandroId, "AlessandroMuci", "alessandro_muci@gmail.com"),
new IdentityUser(_eventHubSeedData.UserMarkId, "MarkGodfrey", "mark_godfrey@gmail.com"),
new IdentityUser(_eventHubSeedData.UserTonyId, "TonyBurton", "tony_burton@gmail.com"),
new IdentityUser(_userSandraId = _guidGenerator.Create(), "SandraWolf", "sandra_wolf@gmail.com"),
new IdentityUser(_userSergeyId = _guidGenerator.Create(), "SergeyPolgul", "sergey_polgul@gmail.com"),
new IdentityUser(_userWellyId = _guidGenerator.Create(), "WellyTambunan", "welly_tambunan@gmail.com"),
new IdentityUser(_userAlessandroId = _guidGenerator.Create(), "AlessandroMuci", "alessandro_muci@gmail.com"),
new IdentityUser(_userMarkId = _guidGenerator.Create(), "MarkGodfrey", "mark_godfrey@gmail.com"),
new IdentityUser(_userTonyId = _guidGenerator.Create(), "TonyBurton", "tony_burton@gmail.com"),
new IdentityUser(_guidGenerator.Create(), "DavidGraus", "david_graus@gmail.com"),
new IdentityUser(_guidGenerator.Create(), "DavidRoss", "david_ross@gmail.com"),
new IdentityUser(_guidGenerator.Create(), "TomLidy", "tom_lidy@gmail.com"),
@ -96,11 +314,11 @@ namespace EventHub
foreach (var user in users)
{
await _identityUserManager.CreateAsync(user, "1q2w3E*");
(await _identityUserManager.CreateAsync(user, "1q2w3E*")).CheckErrors();
}
}
private async Task SeedOrganizationsAsync()
private async Task CreateSampleOrganizationsAsync()
{
if (await _organizationRepository.GetCountAsync() > 0)
{
@ -109,21 +327,21 @@ namespace EventHub
var organizations = new List<Organization>
{
new Organization(_eventHubSeedData.OrganizationVolosoftId, _eventHubSeedData.UserSandraId, "volo",
new Organization(_organizationVolosoftId = Guid.NewGuid(), _userSandraId, "volo",
"Volosoft",
"Volosoft is a company that develops community-driven open source projects and commercial projects. In this organization, you'll get the latest information about Volosoft products such as ABP framework, AspNetZero etc."),
new Organization(_eventHubSeedData.OrganizationAbpId, _eventHubSeedData.UserSergeyId, "abp", "ABP",
new Organization(_organizationAbpId = Guid.NewGuid(), _userSergeyId, "abp", "ABP",
"This group was created to share common information about the ABP framework."),
new Organization(_eventHubSeedData.OrganizationAngularCoderId, _eventHubSeedData.UserWellyId,
new Organization(_organizationAngularCoderId = Guid.NewGuid(), _userWellyId,
"ng-coders", "Angular Coders",
"Angular Coders was created with the goal of sharing Angular knowledge and best-practices as well as providing a space where people can meet up and chat with others working with Angular."),
new Organization(_eventHubSeedData.OrganizationDotnetWorldId, _eventHubSeedData.UserAlessandroId,
new Organization(_organizationDotnetWorldId = Guid.NewGuid(), _userAlessandroId,
"dotnet-world", "Dotnet World",
"Dotnet World is a place for local technology enthusiasts to connect and collaborate around the .NET ecosystem. All that's required is an interest in .NET and a willingness to learn and share."),
new Organization(_eventHubSeedData.OrganizationDeveloperDaysId, _eventHubSeedData.UserMarkId,
new Organization(_organizationDeveloperDaysId = Guid.NewGuid(), _userMarkId,
"developer-days", "Developer Days",
"Developer Days is a platform of resources to help you further your application development! It is intended to further expand your application development and DevOps skills through workshops, tech talks, and social engagements."),
new Organization(_eventHubSeedData.OrganizationCSharpLoversId, _eventHubSeedData.UserTonyId,
new Organization(_organizationCSharpLoversId = Guid.NewGuid(), _userTonyId,
"csharp-lovers", "C# Lovers",
"This group was created with the goal of sharing the latest and best information about C# language. At our monthly meetings you can hear expert speakers who dig 'under the hood' and keep you informed on best practices and future directions.")
};
@ -131,24 +349,24 @@ namespace EventHub
await _organizationRepository.InsertManyAsync(organizations, autoSave: true);
}
private async Task SeedEventsAsync()
private async Task CreateSampleEventsAsync()
{
if (await _eventRepository.GetCountAsync() > 0)
{
return;
}
var organizationDotnetWorld = await _organizationRepository.GetAsync(_eventHubSeedData.OrganizationDotnetWorldId);
var organizationDeveloperDays = await _organizationRepository.GetAsync(_eventHubSeedData.OrganizationDeveloperDaysId);
var organizationCSharpLovers = await _organizationRepository.GetAsync(_eventHubSeedData.OrganizationCSharpLoversId);
var organizationAngularCoders = await _organizationRepository.GetAsync(_eventHubSeedData.OrganizationAngularCoderId);
var organizationVolosoft = await _organizationRepository.GetAsync(_eventHubSeedData.OrganizationVolosoftId);
var organizationAbp = await _organizationRepository.GetAsync(_eventHubSeedData.OrganizationAbpId);
var organizationDotnetWorld = await _organizationRepository.GetAsync(_organizationDotnetWorldId);
var organizationDeveloperDays = await _organizationRepository.GetAsync(_organizationDeveloperDaysId);
var organizationCSharpLovers = await _organizationRepository.GetAsync(_organizationCSharpLoversId);
var organizationAngularCoders = await _organizationRepository.GetAsync(_organizationAngularCoderId);
var organizationVolosoft = await _organizationRepository.GetAsync(_organizationVolosoftId);
var organizationAbp = await _organizationRepository.GetAsync(_organizationAbpId);
var userSandra = await _userRepository.GetAsync(_eventHubSeedData.UserSandraId);
var userTony = await _userRepository.GetAsync(_eventHubSeedData.UserTonyId);
var userAlessandro = await _userRepository.GetAsync(_eventHubSeedData.UserAlessandroId);
var userMark = await _userRepository.GetAsync(_eventHubSeedData.UserMarkId);
var userSandra = await _userRepository.GetAsync(_userSandraId);
var userTony = await _userRepository.GetAsync(_userTonyId);
var userAlessandro = await _userRepository.GetAsync(_userAlessandroId);
var userMark = await _userRepository.GetAsync(_userMarkId);
//10 past events
var pastEvent1 = await _eventManager.CreateAsync(organizationDotnetWorld,
@ -354,215 +572,5 @@ namespace EventHub
await _eventRegistrationManager.RegisterAsync(upcomingEvent15, userMark);
await _eventRegistrationManager.RegisterAsync(upcomingEvent15, userSandra);
}
private async Task SeedCountriesAsync()
{
if (await _countryRepository.GetCountAsync() > 0)
{
return;
}
var countries = new List<Country>
{
new Country(Guid.NewGuid(), "Afghanistan"),
new Country(Guid.NewGuid(), "Albania"),
new Country(Guid.NewGuid(), "Algeria"),
new Country(Guid.NewGuid(), "Andorra"),
new Country(Guid.NewGuid(), "Angola"),
new Country(Guid.NewGuid(), "Antigua and Barbuda"),
new Country(Guid.NewGuid(), "Argentina"),
new Country(Guid.NewGuid(), "Armenia"),
new Country(Guid.NewGuid(), "Australia"),
new Country(Guid.NewGuid(), "Austria"),
new Country(Guid.NewGuid(), "Azerbaijan"),
new Country(Guid.NewGuid(), "Bahamas"),
new Country(Guid.NewGuid(), "Bahrain"),
new Country(Guid.NewGuid(), "Bangladesh"),
new Country(Guid.NewGuid(), "Barbados"),
new Country(Guid.NewGuid(), "Belarus"),
new Country(Guid.NewGuid(), "Belgium"),
new Country(Guid.NewGuid(), "Belize"),
new Country(Guid.NewGuid(), "Benin"),
new Country(Guid.NewGuid(), "Bhutan"),
new Country(Guid.NewGuid(), "Bolivia"),
new Country(Guid.NewGuid(), "Bosnia and Herzegovina"),
new Country(Guid.NewGuid(), "Botswana"),
new Country(Guid.NewGuid(), "Brazil"),
new Country(Guid.NewGuid(), "Brunei"),
new Country(Guid.NewGuid(), "Bulgaria"),
new Country(Guid.NewGuid(), "Burkina Faso"),
new Country(Guid.NewGuid(), "Burundi"),
new Country(Guid.NewGuid(), "Côte d'Ivoire"),
new Country(Guid.NewGuid(), "Cabo Verde"),
new Country(Guid.NewGuid(), "Cambodia"),
new Country(Guid.NewGuid(), "Cameroon"),
new Country(Guid.NewGuid(), "Canada"),
new Country(Guid.NewGuid(), "Central African Republic"),
new Country(Guid.NewGuid(), "Chad"),
new Country(Guid.NewGuid(), "Chile"),
new Country(Guid.NewGuid(), "China"),
new Country(Guid.NewGuid(), "Colombia"),
new Country(Guid.NewGuid(), "Comoros"),
new Country(Guid.NewGuid(), "Congo (Congo-Brazzaville)"),
new Country(Guid.NewGuid(), "Costa Rica"),
new Country(Guid.NewGuid(), "Croatia"),
new Country(Guid.NewGuid(), "Cuba"),
new Country(Guid.NewGuid(), "Cyprus"),
new Country(Guid.NewGuid(), "Czechia (Czech Republic)"),
new Country(Guid.NewGuid(), "Democratic Republic of the Congo"),
new Country(Guid.NewGuid(), "Denmark"),
new Country(Guid.NewGuid(), "Djibouti"),
new Country(Guid.NewGuid(), "Dominica"),
new Country(Guid.NewGuid(), "Dominican Republic"),
new Country(Guid.NewGuid(), "Ecuador"),
new Country(Guid.NewGuid(), "Egypt"),
new Country(Guid.NewGuid(), "El Salvador"),
new Country(Guid.NewGuid(), "Equatorial Guinea"),
new Country(Guid.NewGuid(), "Eritrea"),
new Country(Guid.NewGuid(), "Estonia"),
new Country(Guid.NewGuid(), "Eswatini (formerly Swaziland)"),
new Country(Guid.NewGuid(), "Ethiopia"),
new Country(Guid.NewGuid(), "Fiji"),
new Country(Guid.NewGuid(), "Finland"),
new Country(Guid.NewGuid(), "France"),
new Country(Guid.NewGuid(), "Gabon"),
new Country(Guid.NewGuid(), "Gambia"),
new Country(Guid.NewGuid(), "Georgia"),
new Country(Guid.NewGuid(), "Germany"),
new Country(Guid.NewGuid(), "Ghana"),
new Country(Guid.NewGuid(), "Greece"),
new Country(Guid.NewGuid(), "Grenada"),
new Country(Guid.NewGuid(), "Guatemala"),
new Country(Guid.NewGuid(), "Guinea"),
new Country(Guid.NewGuid(), "Guinea-Bissau"),
new Country(Guid.NewGuid(), "Guyana"),
new Country(Guid.NewGuid(), "Haiti"),
new Country(Guid.NewGuid(), "Holy See"),
new Country(Guid.NewGuid(), "Honduras"),
new Country(Guid.NewGuid(), "Hungary"),
new Country(Guid.NewGuid(), "Iceland"),
new Country(Guid.NewGuid(), "India"),
new Country(Guid.NewGuid(), "Indonesia"),
new Country(Guid.NewGuid(), "Iran"),
new Country(Guid.NewGuid(), "Iraq"),
new Country(Guid.NewGuid(), "Ireland"),
new Country(Guid.NewGuid(), "Israel"),
new Country(Guid.NewGuid(), "Italy"),
new Country(Guid.NewGuid(), "Jamaica"),
new Country(Guid.NewGuid(), "Japan"),
new Country(Guid.NewGuid(), "Jordan"),
new Country(Guid.NewGuid(), "Kazakhstan"),
new Country(Guid.NewGuid(), "Kenya"),
new Country(Guid.NewGuid(), "Kiribati"),
new Country(Guid.NewGuid(), "Kuwait"),
new Country(Guid.NewGuid(), "Kyrgyzstan"),
new Country(Guid.NewGuid(), "Laos"),
new Country(Guid.NewGuid(), "Latvia"),
new Country(Guid.NewGuid(), "Lebanon"),
new Country(Guid.NewGuid(), "Lesotho"),
new Country(Guid.NewGuid(), "Liberia"),
new Country(Guid.NewGuid(), "Libya"),
new Country(Guid.NewGuid(), "Liechtenstein"),
new Country(Guid.NewGuid(), "Lithuania"),
new Country(Guid.NewGuid(), "Luxembourg"),
new Country(Guid.NewGuid(), "Madagascar"),
new Country(Guid.NewGuid(), "Malawi"),
new Country(Guid.NewGuid(), "Malaysia"),
new Country(Guid.NewGuid(), "Maldives"),
new Country(Guid.NewGuid(), "Mali"),
new Country(Guid.NewGuid(), "Malta"),
new Country(Guid.NewGuid(), "Marshall Islands"),
new Country(Guid.NewGuid(), "Mauritania"),
new Country(Guid.NewGuid(), "Mauritius"),
new Country(Guid.NewGuid(), "Mexico"),
new Country(Guid.NewGuid(), "Micronesia"),
new Country(Guid.NewGuid(), "Moldova"),
new Country(Guid.NewGuid(), "Monaco"),
new Country(Guid.NewGuid(), "Mongolia"),
new Country(Guid.NewGuid(), "Montenegro"),
new Country(Guid.NewGuid(), "Morocco"),
new Country(Guid.NewGuid(), "Mozambique"),
new Country(Guid.NewGuid(), "Myanmar (formerly Burma)"),
new Country(Guid.NewGuid(), "Namibia"),
new Country(Guid.NewGuid(), "Nauru"),
new Country(Guid.NewGuid(), "Nepal"),
new Country(Guid.NewGuid(), "Netherlands"),
new Country(Guid.NewGuid(), "New Zealand"),
new Country(Guid.NewGuid(), "Nicaragua"),
new Country(Guid.NewGuid(), "Niger"),
new Country(Guid.NewGuid(), "Nigeria"),
new Country(Guid.NewGuid(), "North Korea"),
new Country(Guid.NewGuid(), "North Macedonia"),
new Country(Guid.NewGuid(), "Norway"),
new Country(Guid.NewGuid(), "Oman"),
new Country(Guid.NewGuid(), "Pakistan"),
new Country(Guid.NewGuid(), "Palau"),
new Country(Guid.NewGuid(), "Palestine State"),
new Country(Guid.NewGuid(), "Panama"),
new Country(Guid.NewGuid(), "Papua New Guinea"),
new Country(Guid.NewGuid(), "Paraguay"),
new Country(Guid.NewGuid(), "Peru"),
new Country(Guid.NewGuid(), "Philippines"),
new Country(Guid.NewGuid(), "Poland"),
new Country(Guid.NewGuid(), "Portugal"),
new Country(Guid.NewGuid(), "Qatar"),
new Country(Guid.NewGuid(), "Romania"),
new Country(Guid.NewGuid(), "Russia"),
new Country(Guid.NewGuid(), "Rwanda"),
new Country(Guid.NewGuid(), "Saint Kitts and Nevis"),
new Country(Guid.NewGuid(), "Saint Lucia"),
new Country(Guid.NewGuid(), "Saint Vincent and the Grenadines"),
new Country(Guid.NewGuid(), "Samoa"),
new Country(Guid.NewGuid(), "San Marino"),
new Country(Guid.NewGuid(), "Sao Tome and Principe"),
new Country(Guid.NewGuid(), "Saudi Arabia"),
new Country(Guid.NewGuid(), "Senegal"),
new Country(Guid.NewGuid(), "Serbia"),
new Country(Guid.NewGuid(), "Seychelles"),
new Country(Guid.NewGuid(), "Sierra Leone"),
new Country(Guid.NewGuid(), "Singapore"),
new Country(Guid.NewGuid(), "Slovakia"),
new Country(Guid.NewGuid(), "Slovenia"),
new Country(Guid.NewGuid(), "Solomon Islands"),
new Country(Guid.NewGuid(), "Somalia"),
new Country(Guid.NewGuid(), "South Africa"),
new Country(Guid.NewGuid(), "South Korea"),
new Country(Guid.NewGuid(), "South Sudan"),
new Country(Guid.NewGuid(), "Spain"),
new Country(Guid.NewGuid(), "Sri Lanka"),
new Country(Guid.NewGuid(), "Sudan"),
new Country(Guid.NewGuid(), "Suriname"),
new Country(Guid.NewGuid(), "Sweden"),
new Country(Guid.NewGuid(), "Switzerland"),
new Country(Guid.NewGuid(), "Syria"),
new Country(Guid.NewGuid(), "Tajikistan"),
new Country(Guid.NewGuid(), "Tanzania"),
new Country(Guid.NewGuid(), "Thailand"),
new Country(Guid.NewGuid(), "Timor-Leste"),
new Country(Guid.NewGuid(), "Togo"),
new Country(Guid.NewGuid(), "Tonga"),
new Country(Guid.NewGuid(), "Trinidad and Tobago"),
new Country(Guid.NewGuid(), "Tunisia"),
new Country(Guid.NewGuid(), "Turkey"),
new Country(Guid.NewGuid(), "Turkmenistan"),
new Country(Guid.NewGuid(), "Tuvalu"),
new Country(Guid.NewGuid(), "Uganda"),
new Country(Guid.NewGuid(), "Ukraine"),
new Country(Guid.NewGuid(), "United Arab Emirates"),
new Country(Guid.NewGuid(), "United Kingdom"),
new Country(Guid.NewGuid(), "United States of America"),
new Country(Guid.NewGuid(), "Uruguay"),
new Country(Guid.NewGuid(), "Uzbekistan"),
new Country(Guid.NewGuid(), "Vanuatu"),
new Country(Guid.NewGuid(), "Venezuela"),
new Country(Guid.NewGuid(), "Vietnam"),
new Country(Guid.NewGuid(), "Yemen"),
new Country(Guid.NewGuid(), "Zambia"),
new Country(Guid.NewGuid(), "Zimbabwe")
};
await _countryRepository.InsertManyAsync(countries);
}
}
}

24
src/EventHub.Domain/EventHubSeedData.cs

@ -1,24 +0,0 @@
using System;
using Volo.Abp.DependencyInjection;
namespace EventHub
{
public class EventHubSeedData : ISingletonDependency
{
//USERS
public Guid UserSandraId { get; } = Guid.NewGuid();
public Guid UserSergeyId { get; } = Guid.NewGuid();
public Guid UserWellyId { get; } = Guid.NewGuid();
public Guid UserAlessandroId { get; } = Guid.NewGuid();
public Guid UserMarkId { get; } = Guid.NewGuid();
public Guid UserTonyId { get; set; } = Guid.NewGuid();
//ORGANIZATIONS
public Guid OrganizationVolosoftId { get; } = Guid.NewGuid();
public Guid OrganizationAbpId { get; } = Guid.NewGuid();
public Guid OrganizationAngularCoderId { get; } = Guid.NewGuid();
public Guid OrganizationDotnetWorldId { get; } = Guid.NewGuid();
public Guid OrganizationDeveloperDaysId { get; } = Guid.NewGuid();
public Guid OrganizationCSharpLoversId { get; } = Guid.NewGuid();
}
}
Loading…
Cancel
Save