mirror of https://github.com/abpframework/eventhub
committed by
GitHub
93 changed files with 4035 additions and 6782 deletions
@ -1,78 +0,0 @@ |
|||
using System; |
|||
using Volo.Abp.Domain.Entities.Auditing; |
|||
using Volo.Abp.Users; |
|||
|
|||
namespace EventHub.Users |
|||
{ |
|||
/* This entity shares the same table/collection ("AbpUsers" by default) with the |
|||
* IdentityUser entity of the Identity module. |
|||
* |
|||
* - You can define your custom properties into this class. |
|||
* - You never create or delete this entity, because it is Identity module's job. |
|||
* - You can query users from database with this entity. |
|||
* - You can update values of your custom properties. |
|||
*/ |
|||
public class AppUser : FullAuditedAggregateRoot<Guid>, IUser |
|||
{ |
|||
#region Base properties
|
|||
|
|||
/* These properties are shared with the IdentityUser entity of the Identity module. |
|||
* Do not change these properties through this class. Instead, use Identity module |
|||
* services (like IdentityUserManager) to change them. |
|||
* So, this properties are designed as read only! |
|||
*/ |
|||
|
|||
public virtual Guid? TenantId { get; private set; } |
|||
|
|||
public virtual string UserName { get; private set; } |
|||
|
|||
public virtual string Name { get; private set; } |
|||
|
|||
public virtual string Surname { get; private set; } |
|||
|
|||
public virtual string Email { get; private set; } |
|||
|
|||
public virtual bool EmailConfirmed { get; private set; } |
|||
|
|||
public virtual string PhoneNumber { get; private set; } |
|||
|
|||
public virtual bool PhoneNumberConfirmed { get; private set; } |
|||
|
|||
#endregion
|
|||
|
|||
/* Add your own properties here. Example: |
|||
* |
|||
* public string MyProperty { get; set; } |
|||
* |
|||
* If you add a property and using the EF Core, remember these; |
|||
* |
|||
* 1. Update EventHubDbContext.OnModelCreating |
|||
* to configure the mapping for your new property |
|||
* 2. Update EventHubEfCoreEntityExtensionMappings to extend the IdentityUser entity |
|||
* and add your new property to the migration. |
|||
* 3. Use the Add-Migration to add a new database migration. |
|||
* 4. Run the .DbMigrator project (or use the Update-Database command) to apply |
|||
* schema change to the database. |
|||
*/ |
|||
|
|||
private AppUser() |
|||
{ |
|||
|
|||
} |
|||
|
|||
public string GetFullNameOrUsername() |
|||
{ |
|||
if (!string.IsNullOrWhiteSpace(Name) && !string.IsNullOrWhiteSpace(Surname)) |
|||
{ |
|||
return Name + " " + Surname; |
|||
} |
|||
|
|||
if (!string.IsNullOrWhiteSpace(Name)) |
|||
{ |
|||
return Name; |
|||
} |
|||
|
|||
return UserName; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,22 @@ |
|||
using Volo.Abp.Identity; |
|||
|
|||
namespace EventHub.Users |
|||
{ |
|||
public static class EventHubIdentityUserExtensions |
|||
{ |
|||
public static string GetFullNameOrUsername(this IdentityUser user) |
|||
{ |
|||
if (!string.IsNullOrWhiteSpace(user.Name) && !string.IsNullOrWhiteSpace(user.Surname)) |
|||
{ |
|||
return user.Name + " " + user.Surname; |
|||
} |
|||
|
|||
if (!string.IsNullOrWhiteSpace(user.Name)) |
|||
{ |
|||
return user.Name; |
|||
} |
|||
|
|||
return user.UserName; |
|||
} |
|||
} |
|||
} |
|||
@ -1,16 +0,0 @@ |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace EventHub.EntityFrameworkCore |
|||
{ |
|||
[DependsOn( |
|||
typeof(EventHubEntityFrameworkCoreModule) |
|||
)] |
|||
public class EventHubEntityFrameworkCoreDbMigrationsModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
context.Services.AddAbpDbContext<EventHubMigrationsDbContext>(); |
|||
} |
|||
} |
|||
} |
|||
@ -1,47 +0,0 @@ |
|||
using EventHub.Events.Registrations; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Volo.Abp.AuditLogging.EntityFrameworkCore; |
|||
using Volo.Abp.BackgroundJobs.EntityFrameworkCore; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
using Volo.Abp.Identity; |
|||
using Volo.Abp.Identity.EntityFrameworkCore; |
|||
using Volo.Abp.IdentityServer.EntityFrameworkCore; |
|||
using Volo.Abp.PermissionManagement.EntityFrameworkCore; |
|||
using Volo.Abp.SettingManagement.EntityFrameworkCore; |
|||
using Volo.Abp.BlobStoring.Database.EntityFrameworkCore; |
|||
|
|||
namespace EventHub.EntityFrameworkCore |
|||
{ |
|||
/* This DbContext is only used for database migrations. |
|||
* It is not used on runtime. See EventHubDbContext for the runtime DbContext. |
|||
* It is a unified model that includes configuration for |
|||
* all used modules and your application. |
|||
*/ |
|||
public class EventHubMigrationsDbContext : AbpDbContext<EventHubMigrationsDbContext> |
|||
{ |
|||
public EventHubMigrationsDbContext(DbContextOptions<EventHubMigrationsDbContext> options) |
|||
: base(options) |
|||
{ |
|||
|
|||
} |
|||
|
|||
protected override void OnModelCreating(ModelBuilder builder) |
|||
{ |
|||
base.OnModelCreating(builder); |
|||
|
|||
/* Include modules to your migration db context */ |
|||
|
|||
builder.ConfigurePermissionManagement(); |
|||
builder.ConfigureSettingManagement(); |
|||
builder.ConfigureBackgroundJobs(); |
|||
builder.ConfigureAuditLogging(); |
|||
builder.ConfigureIdentity(); |
|||
builder.ConfigureIdentityServer(); |
|||
|
|||
/* Configure your own tables/entities inside the ConfigureEventHub method */ |
|||
|
|||
builder.ConfigureEventHub(true); |
|||
builder.ConfigureBlobStoring(); |
|||
} |
|||
} |
|||
} |
|||
@ -1,18 +0,0 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<Import Project="..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>net5.0</TargetFramework> |
|||
<RootNamespace>EventHub</RootNamespace> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\EventHub.EntityFrameworkCore\EventHub.EntityFrameworkCore.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.*" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
File diff suppressed because it is too large
@ -1,23 +0,0 @@ |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
namespace EventHub.Migrations |
|||
{ |
|||
public partial class Added_CountryName_To_Event : Migration |
|||
{ |
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AddColumn<string>( |
|||
name: "CountryName", |
|||
table: "EhEvents", |
|||
type: "text", |
|||
nullable: true); |
|||
} |
|||
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropColumn( |
|||
name: "CountryName", |
|||
table: "EhEvents"); |
|||
} |
|||
} |
|||
} |
|||
@ -1,35 +0,0 @@ |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
namespace EventHub.Migrations |
|||
{ |
|||
public partial class Moved_IsTimingChangeEmailSent_To_Event : Migration |
|||
{ |
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropColumn( |
|||
name: "IsTimingChangeEmailSent", |
|||
table: "EhEventRegistrations"); |
|||
|
|||
migrationBuilder.AddColumn<bool>( |
|||
name: "IsTimingChangeEmailSent", |
|||
table: "EhEvents", |
|||
type: "boolean", |
|||
nullable: false, |
|||
defaultValue: true); |
|||
} |
|||
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropColumn( |
|||
name: "IsTimingChangeEmailSent", |
|||
table: "EhEvents"); |
|||
|
|||
migrationBuilder.AddColumn<bool>( |
|||
name: "IsTimingChangeEmailSent", |
|||
table: "EhEventRegistrations", |
|||
type: "boolean", |
|||
nullable: false, |
|||
defaultValue: true); |
|||
} |
|||
} |
|||
} |
|||
File diff suppressed because it is too large
@ -0,0 +1,33 @@ |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
namespace EventHub.Migrations |
|||
{ |
|||
public partial class Upgrade_Abp_4_4 : Migration |
|||
{ |
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "Exceptions", |
|||
table: "AbpAuditLogs", |
|||
type: "text", |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "character varying(4000)", |
|||
oldMaxLength: 4000, |
|||
oldNullable: true); |
|||
} |
|||
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "Exceptions", |
|||
table: "AbpAuditLogs", |
|||
type: "character varying(4000)", |
|||
maxLength: 4000, |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "text", |
|||
oldNullable: true); |
|||
} |
|||
} |
|||
} |
|||
File diff suppressed because it is too large
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue