Browse Source

Refactor eventhub.

pull/29/head
Halil İbrahim Kalkan 6 years ago
parent
commit
8525d82914
  1. 2
      src/EventHub.Domain/Data/IdentityServerDataSeedContributor.cs
  2. 20
      src/EventHub.Domain/Events/Event.cs
  3. 2
      src/EventHub.Domain/Events/EventCoverImageContainer.cs
  4. 3
      src/EventHub.Domain/Events/EventManager.cs
  5. 2
      src/EventHub.Domain/Organizations/Organization.cs
  6. 2
      src/EventHub.Domain/Organizations/OrganizationProfilePictureContainer.cs

2
src/EventHub.Domain/IdentityServer/IdentityServerDataSeedContributor.cs → src/EventHub.Domain/Data/IdentityServerDataSeedContributor.cs

@ -18,7 +18,7 @@ using ApiResource = Volo.Abp.IdentityServer.ApiResources.ApiResource;
using ApiScope = Volo.Abp.IdentityServer.ApiScopes.ApiScope; using ApiScope = Volo.Abp.IdentityServer.ApiScopes.ApiScope;
using Client = Volo.Abp.IdentityServer.Clients.Client; using Client = Volo.Abp.IdentityServer.Clients.Client;
namespace EventHub.IdentityServer namespace EventHub.Data
{ {
public class IdentityServerDataSeedContributor : IDataSeedContributor, ITransientDependency public class IdentityServerDataSeedContributor : IDataSeedContributor, ITransientDependency
{ {

20
src/EventHub.Domain/Events/Event.cs

@ -85,29 +85,27 @@ namespace EventHub.Events
return this; return this;
} }
public Event SetLocation(bool isOnline, string onlineLink, Guid? countryId, string city) public Event SetLocation(
bool isOnline,
string onlineLink,
Guid? countryId,
string city)
{ {
IsOnline = isOnline; IsOnline = isOnline;
if (isOnline) if (IsOnline)
{ {
if (!onlineLink.IsNullOrWhiteSpace()) OnlineLink = onlineLink;
{
OnlineLink = onlineLink;
}
CountryId = null; CountryId = null;
City = null; City = null;
return this;
} }
else
if (countryId.HasValue && !city.IsNullOrWhiteSpace())
{ {
OnlineLink = null;
CountryId = countryId; CountryId = countryId;
City = city; City = city;
} }
OnlineLink = null;
return this; return this;
} }
} }

2
src/EventHub.Domain/Events/EventCoverImageContainer.cs

@ -2,7 +2,7 @@ using Volo.Abp.BlobStoring;
namespace EventHub.Events namespace EventHub.Events
{ {
[BlobContainerName("event-cover-images")] [BlobContainerName("eventhub-event-cover-images")]
public class EventCoverImageContainer public class EventCoverImageContainer
{ {

3
src/EventHub.Domain/Events/EventManager.cs

@ -53,8 +53,7 @@ namespace EventHub.Events
bool isOnline, bool isOnline,
string onlineLink, string onlineLink,
string city, string city,
int? capacity int? capacity)
)
{ {
var @event = await _eventRepository.GetAsync(id); var @event = await _eventRepository.GetAsync(id);
var registeredUserCount = await _eventRegistrationRepository.CountAsync(x => x.EventId == @event.Id); var registeredUserCount = await _eventRegistrationRepository.CountAsync(x => x.EventId == @event.Id);

2
src/EventHub.Domain/Organizations/Organization.cs

@ -6,7 +6,7 @@ namespace EventHub.Organizations
{ {
public class Organization : FullAuditedAggregateRoot<Guid> public class Organization : FullAuditedAggregateRoot<Guid>
{ {
public Guid OwnerUserId { get; set; } public Guid OwnerUserId { get; private set; }
public string Name { get; private set; } public string Name { get; private set; }

2
src/EventHub.Domain/Organizations/OrganizationProfilePictureContainer.cs

@ -2,7 +2,7 @@ using Volo.Abp.BlobStoring;
namespace EventHub.Organizations namespace EventHub.Organizations
{ {
[BlobContainerName("organization-profile-pictures")] [BlobContainerName("eventhub-organization-profile-pictures")]
public class OrganizationProfilePictureContainer public class OrganizationProfilePictureContainer
{ {

Loading…
Cancel
Save