Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
ProjectsStatusManagement
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hasan.bahjat
ProjectsStatusManagement
Commits
804e6ccf
Commit
804e6ccf
authored
Jul 28, 2024
by
hasan khaddour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix s.
parent
1ae9e12a
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
506 additions
and
70 deletions
+506
-70
AppDbContext.cs
...Infrastructure.Persistence/AppDataContext/AppDbContext.cs
+4
-13
CustomerEntityConfiguration.cs
...ence/EntitiesConfiguration/CustomerEntityConfiguration.cs
+33
-0
20240728124023_AddCustomer2.Designer.cs
...stence/Migrations/20240728124023_AddCustomer2.Designer.cs
+172
-0
20240728124023_AddCustomer2.cs
...ure.Persistence/Migrations/20240728124023_AddCustomer2.cs
+73
-0
20240728142935_AddCustomer3.Designer.cs
...stence/Migrations/20240728142935_AddCustomer3.Designer.cs
+130
-0
20240728142935_AddCustomer3.cs
...ure.Persistence/Migrations/20240728142935_AddCustomer3.cs
+63
-0
AppDbContextModelSnapshot.cs
...cture.Persistence/Migrations/AppDbContextModelSnapshot.cs
+15
-51
PSManagement.Infrastructure.Persistence.csproj
...ersistence/PSManagement.Infrastructure.Persistence.csproj
+1
-5
IDomainEvent.cs
PSManagement.SharedKernel/DomainEvents/IDomainEvent.cs
+1
-1
IDomainEventHandler.cs
...nagement.SharedKernel/DomainEvents/IDomainEventHandler.cs
+14
-0
No files found.
PSManagement.Infrastructure.Persistence/AppDataContext/AppDbContext.cs
View file @
804e6ccf
...
@@ -18,21 +18,12 @@ namespace PSManagement.Infrastructure.Persistence
...
@@ -18,21 +18,12 @@ namespace PSManagement.Infrastructure.Persistence
protected
override
void
OnModelCreating
(
ModelBuilder
modelBuilder
)
protected
override
void
OnModelCreating
(
ModelBuilder
modelBuilder
)
{
{
modelBuilder
.
ApplyConfigurationsFromAssembly
(
typeof
(
AppDbContext
).
Assembly
);
base
.
OnModelCreating
(
modelBuilder
);
base
.
OnModelCreating
(
modelBuilder
);
modelBuilder
.
HasAnnotation
(
"Relational:Collation"
,
"Arabic_CI_AS"
);
modelBuilder
.
Entity
<
Customer
>(
builder
=>
{
builder
.
OwnsOne
(
c
=>
c
.
Address
);
});
modelBuilder
.
HasAnnotation
(
"Relational:Collation"
,
"Arabic_CI_AS"
);
modelBuilder
.
Entity
<
Customer
>(
builder
=>
{
builder
.
OwnsMany
(
c
=>
c
.
ContactInfo
,
contactInfoBuilder
=>
{
contactInfoBuilder
.
OwnsOne
(
c
=>
c
.
MobileNumber
);
contactInfoBuilder
.
OwnsOne
(
c
=>
c
.
PhoneNumber
);
});
});
}
}
...
...
PSManagement.Infrastructure.Persistence/EntitiesConfiguration/CustomerEntityConfiguration.cs
0 → 100644
View file @
804e6ccf
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore.Metadata.Builders
;
using
PSManagement.Domain.Customers.Aggregate
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
PSManagement.Infrastructure.Persistence.EntitiesConfiguration
{
public
class
CustomerEntityConfiguration
:
IEntityTypeConfiguration
<
Customer
>
{
public
void
Configure
(
EntityTypeBuilder
<
Customer
>
builder
)
{
builder
.
OwnsOne
(
c
=>
c
.
Address
,
address
=>
{
address
.
Property
(
a
=>
a
.
StreetName
).
HasColumnName
(
"StreetName"
);
address
.
Property
(
a
=>
a
.
City
).
HasColumnName
(
"City"
);
address
.
Property
(
a
=>
a
.
StreetNumber
).
HasColumnName
(
"StreetNumber"
);
address
.
Property
(
a
=>
a
.
ZipCode
).
HasColumnName
(
"ZipCode"
);
}
);
builder
.
OwnsMany
(
c
=>
c
.
ContactInfo
);
}
}
}
PSManagement.Infrastructure.Persistence/Migrations/20240728124023_AddCustomer2.Designer.cs
0 → 100644
View file @
804e6ccf
// <auto-generated />
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore.Infrastructure
;
using
Microsoft.EntityFrameworkCore.Metadata
;
using
Microsoft.EntityFrameworkCore.Migrations
;
using
Microsoft.EntityFrameworkCore.Storage.ValueConversion
;
using
PSManagement.Infrastructure.Persistence
;
namespace
PSManagement.Infrastructure.Persistence.Migrations
{
[
DbContext
(
typeof
(
AppDbContext
))]
[
Migration
(
"20240728124023_AddCustomer2"
)]
partial
class
AddCustomer2
{
protected
override
void
BuildTargetModel
(
ModelBuilder
modelBuilder
)
{
#pragma warning disable 612, 618
modelBuilder
.
HasAnnotation
(
"Relational:Collation"
,
"Arabic_CI_AS"
)
.
HasAnnotation
(
"Relational:MaxIdentifierLength"
,
128
)
.
HasAnnotation
(
"ProductVersion"
,
"5.0.17"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
modelBuilder
.
Entity
(
"PSManagement.Domain.Customers.Aggregate.Customer"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
string
>(
"CustomerName"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"Customers"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Identity.Aggregate.User"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
string
>(
"Email"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
string
>(
"FirstName"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
string
>(
"HashedPassword"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
string
>(
"LastName"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"Users"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Customers.Aggregate.Customer"
,
b
=>
{
b
.
OwnsMany
(
"PSManagement.Domain.Customers.Entities.ContactInfo"
,
"ContactInfo"
,
b1
=>
{
b1
.
Property
<
int
>(
"CustomerId"
)
.
HasColumnType
(
"int"
);
b1
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b1
.
Property
<
string
>(
"Email"
)
.
HasColumnType
(
"nvarchar(max)"
);
b1
.
HasKey
(
"CustomerId"
,
"Id"
);
b1
.
ToTable
(
"ContactInfo"
);
b1
.
WithOwner
()
.
HasForeignKey
(
"CustomerId"
);
b1
.
OwnsOne
(
"PSManagement.Domain.Customers.ValueObjects.ContactNumber"
,
"MobileNumber"
,
b2
=>
{
b2
.
Property
<
int
>(
"ContactInfoCustomerId"
)
.
HasColumnType
(
"int"
);
b2
.
Property
<
int
>(
"ContactInfoId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b2
.
Property
<
int
>(
"Number"
)
.
HasColumnType
(
"int"
)
.
HasColumnName
(
"MobileNumber"
);
b2
.
HasKey
(
"ContactInfoCustomerId"
,
"ContactInfoId"
);
b2
.
ToTable
(
"ContactInfo"
);
b2
.
WithOwner
()
.
HasForeignKey
(
"ContactInfoCustomerId"
,
"ContactInfoId"
);
});
b1
.
OwnsOne
(
"PSManagement.Domain.Customers.ValueObjects.ContactNumber"
,
"PhoneNumber"
,
b2
=>
{
b2
.
Property
<
int
>(
"ContactInfoCustomerId"
)
.
HasColumnType
(
"int"
);
b2
.
Property
<
int
>(
"ContactInfoId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b2
.
Property
<
int
>(
"Number"
)
.
HasColumnType
(
"int"
)
.
HasColumnName
(
"PhoneNumber"
);
b2
.
HasKey
(
"ContactInfoCustomerId"
,
"ContactInfoId"
);
b2
.
ToTable
(
"ContactInfo"
);
b2
.
WithOwner
()
.
HasForeignKey
(
"ContactInfoCustomerId"
,
"ContactInfoId"
);
});
b1
.
Navigation
(
"MobileNumber"
);
b1
.
Navigation
(
"PhoneNumber"
);
});
b
.
OwnsOne
(
"PSManagement.Domain.Customers.ValueObjects.Address"
,
"Address"
,
b1
=>
{
b1
.
Property
<
int
>(
"CustomerId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b1
.
Property
<
string
>(
"City"
)
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"City"
);
b1
.
Property
<
string
>(
"StreetName"
)
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"StreetName"
);
b1
.
Property
<
int
>(
"StreetNumber"
)
.
HasColumnType
(
"int"
)
.
HasColumnName
(
"StreetNumber"
);
b1
.
Property
<
int
>(
"ZipCode"
)
.
HasColumnType
(
"int"
)
.
HasColumnName
(
"ZipCode"
);
b1
.
HasKey
(
"CustomerId"
);
b1
.
ToTable
(
"Customers"
);
b1
.
WithOwner
()
.
HasForeignKey
(
"CustomerId"
);
});
b
.
Navigation
(
"Address"
);
b
.
Navigation
(
"ContactInfo"
);
});
#pragma warning restore 612, 618
}
}
}
PSManagement.Infrastructure.Persistence/Migrations/20240728124023_AddCustomer2.cs
0 → 100644
View file @
804e6ccf
using
Microsoft.EntityFrameworkCore.Migrations
;
namespace
PSManagement.Infrastructure.Persistence.Migrations
{
public
partial
class
AddCustomer2
:
Migration
{
protected
override
void
Up
(
MigrationBuilder
migrationBuilder
)
{
migrationBuilder
.
RenameColumn
(
name
:
"Address_ZipCode"
,
table
:
"Customers"
,
newName
:
"ZipCode"
);
migrationBuilder
.
RenameColumn
(
name
:
"Address_StreetNumber"
,
table
:
"Customers"
,
newName
:
"StreetNumber"
);
migrationBuilder
.
RenameColumn
(
name
:
"Address_StreetName"
,
table
:
"Customers"
,
newName
:
"StreetName"
);
migrationBuilder
.
RenameColumn
(
name
:
"Address_City"
,
table
:
"Customers"
,
newName
:
"City"
);
migrationBuilder
.
RenameColumn
(
name
:
"PhoneNumber_Number"
,
table
:
"ContactInfo"
,
newName
:
"PhoneNumber"
);
migrationBuilder
.
RenameColumn
(
name
:
"MobileNumber_Number"
,
table
:
"ContactInfo"
,
newName
:
"MobileNumber"
);
}
protected
override
void
Down
(
MigrationBuilder
migrationBuilder
)
{
migrationBuilder
.
RenameColumn
(
name
:
"ZipCode"
,
table
:
"Customers"
,
newName
:
"Address_ZipCode"
);
migrationBuilder
.
RenameColumn
(
name
:
"StreetNumber"
,
table
:
"Customers"
,
newName
:
"Address_StreetNumber"
);
migrationBuilder
.
RenameColumn
(
name
:
"StreetName"
,
table
:
"Customers"
,
newName
:
"Address_StreetName"
);
migrationBuilder
.
RenameColumn
(
name
:
"City"
,
table
:
"Customers"
,
newName
:
"Address_City"
);
migrationBuilder
.
RenameColumn
(
name
:
"PhoneNumber"
,
table
:
"ContactInfo"
,
newName
:
"PhoneNumber_Number"
);
migrationBuilder
.
RenameColumn
(
name
:
"MobileNumber"
,
table
:
"ContactInfo"
,
newName
:
"MobileNumber_Number"
);
}
}
}
PSManagement.Infrastructure.Persistence/Migrations/20240728142935_AddCustomer3.Designer.cs
0 → 100644
View file @
804e6ccf
// <auto-generated />
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore.Infrastructure
;
using
Microsoft.EntityFrameworkCore.Metadata
;
using
Microsoft.EntityFrameworkCore.Migrations
;
using
Microsoft.EntityFrameworkCore.Storage.ValueConversion
;
using
PSManagement.Infrastructure.Persistence
;
namespace
PSManagement.Infrastructure.Persistence.Migrations
{
[
DbContext
(
typeof
(
AppDbContext
))]
[
Migration
(
"20240728142935_AddCustomer3"
)]
partial
class
AddCustomer3
{
protected
override
void
BuildTargetModel
(
ModelBuilder
modelBuilder
)
{
#pragma warning disable 612, 618
modelBuilder
.
HasAnnotation
(
"Relational:Collation"
,
"Arabic_CI_AS"
)
.
HasAnnotation
(
"Relational:MaxIdentifierLength"
,
128
)
.
HasAnnotation
(
"ProductVersion"
,
"5.0.17"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
modelBuilder
.
Entity
(
"PSManagement.Domain.Customers.Aggregate.Customer"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
string
>(
"CustomerName"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
string
>(
"Email"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"Customers"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Identity.Aggregate.User"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
string
>(
"Email"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
string
>(
"FirstName"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
string
>(
"HashedPassword"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
string
>(
"LastName"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"Users"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Customers.Aggregate.Customer"
,
b
=>
{
b
.
OwnsMany
(
"PSManagement.Domain.Customers.Entities.ContactInfo"
,
"ContactInfo"
,
b1
=>
{
b1
.
Property
<
int
>(
"CustomerId"
)
.
HasColumnType
(
"int"
);
b1
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b1
.
Property
<
string
>(
"ConatctValue"
)
.
HasColumnType
(
"nvarchar(max)"
);
b1
.
Property
<
string
>(
"ContactType"
)
.
HasColumnType
(
"nvarchar(max)"
);
b1
.
HasKey
(
"CustomerId"
,
"Id"
);
b1
.
ToTable
(
"ContactInfo"
);
b1
.
WithOwner
()
.
HasForeignKey
(
"CustomerId"
);
});
b
.
OwnsOne
(
"PSManagement.Domain.Customers.ValueObjects.Address"
,
"Address"
,
b1
=>
{
b1
.
Property
<
int
>(
"CustomerId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b1
.
Property
<
string
>(
"City"
)
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"City"
);
b1
.
Property
<
string
>(
"StreetName"
)
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"StreetName"
);
b1
.
Property
<
int
>(
"StreetNumber"
)
.
HasColumnType
(
"int"
)
.
HasColumnName
(
"StreetNumber"
);
b1
.
Property
<
int
>(
"ZipCode"
)
.
HasColumnType
(
"int"
)
.
HasColumnName
(
"ZipCode"
);
b1
.
HasKey
(
"CustomerId"
);
b1
.
ToTable
(
"Customers"
);
b1
.
WithOwner
()
.
HasForeignKey
(
"CustomerId"
);
});
b
.
Navigation
(
"Address"
);
b
.
Navigation
(
"ContactInfo"
);
});
#pragma warning restore 612, 618
}
}
}
PSManagement.Infrastructure.Persistence/Migrations/20240728142935_AddCustomer3.cs
0 → 100644
View file @
804e6ccf
using
Microsoft.EntityFrameworkCore.Migrations
;
namespace
PSManagement.Infrastructure.Persistence.Migrations
{
public
partial
class
AddCustomer3
:
Migration
{
protected
override
void
Up
(
MigrationBuilder
migrationBuilder
)
{
migrationBuilder
.
DropColumn
(
name
:
"MobileNumber"
,
table
:
"ContactInfo"
);
migrationBuilder
.
DropColumn
(
name
:
"PhoneNumber"
,
table
:
"ContactInfo"
);
migrationBuilder
.
RenameColumn
(
name
:
"Email"
,
table
:
"ContactInfo"
,
newName
:
"ContactType"
);
migrationBuilder
.
AddColumn
<
string
>(
name
:
"Email"
,
table
:
"Customers"
,
type
:
"nvarchar(max)"
,
nullable
:
true
);
migrationBuilder
.
AddColumn
<
string
>(
name
:
"ConatctValue"
,
table
:
"ContactInfo"
,
type
:
"nvarchar(max)"
,
nullable
:
true
);
}
protected
override
void
Down
(
MigrationBuilder
migrationBuilder
)
{
migrationBuilder
.
DropColumn
(
name
:
"Email"
,
table
:
"Customers"
);
migrationBuilder
.
DropColumn
(
name
:
"ConatctValue"
,
table
:
"ContactInfo"
);
migrationBuilder
.
RenameColumn
(
name
:
"ContactType"
,
table
:
"ContactInfo"
,
newName
:
"Email"
);
migrationBuilder
.
AddColumn
<
int
>(
name
:
"MobileNumber"
,
table
:
"ContactInfo"
,
type
:
"int"
,
nullable
:
true
);
migrationBuilder
.
AddColumn
<
int
>(
name
:
"PhoneNumber"
,
table
:
"ContactInfo"
,
type
:
"int"
,
nullable
:
true
);
}
}
}
PSManagement.Infrastructure.Persistence/Migrations/AppDbContextModelSnapshot.cs
View file @
804e6ccf
...
@@ -29,6 +29,9 @@ namespace PSManagement.Infrastructure.Persistence.Migrations
...
@@ -29,6 +29,9 @@ namespace PSManagement.Infrastructure.Persistence.Migrations
b
.
Property
<
string
>(
"CustomerName"
)
b
.
Property
<
string
>(
"CustomerName"
)
.
HasColumnType
(
"nvarchar(max)"
);
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
string
>(
"Email"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
HasKey
(
"Id"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"Customers"
);
b
.
ToTable
(
"Customers"
);
...
@@ -70,7 +73,10 @@ namespace PSManagement.Infrastructure.Persistence.Migrations
...
@@ -70,7 +73,10 @@ namespace PSManagement.Infrastructure.Persistence.Migrations
.
HasColumnType
(
"int"
)
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b1
.
Property
<
string
>(
"Email"
)
b1
.
Property
<
string
>(
"ConatctValue"
)
.
HasColumnType
(
"nvarchar(max)"
);
b1
.
Property
<
string
>(
"ContactType"
)
.
HasColumnType
(
"nvarchar(max)"
);
.
HasColumnType
(
"nvarchar(max)"
);
b1
.
HasKey
(
"CustomerId"
,
"Id"
);
b1
.
HasKey
(
"CustomerId"
,
"Id"
);
...
@@ -79,52 +85,6 @@ namespace PSManagement.Infrastructure.Persistence.Migrations
...
@@ -79,52 +85,6 @@ namespace PSManagement.Infrastructure.Persistence.Migrations
b1
.
WithOwner
()
b1
.
WithOwner
()
.
HasForeignKey
(
"CustomerId"
);
.
HasForeignKey
(
"CustomerId"
);
b1
.
OwnsOne
(
"PSManagement.Domain.Customers.ValueObjects.ContactNumber"
,
"MobileNumber"
,
b2
=>
{
b2
.
Property
<
int
>(
"ContactInfoCustomerId"
)
.
HasColumnType
(
"int"
);
b2
.
Property
<
int
>(
"ContactInfoId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b2
.
Property
<
int
>(
"Number"
)
.
HasColumnType
(
"int"
);
b2
.
HasKey
(
"ContactInfoCustomerId"
,
"ContactInfoId"
);
b2
.
ToTable
(
"ContactInfo"
);
b2
.
WithOwner
()
.
HasForeignKey
(
"ContactInfoCustomerId"
,
"ContactInfoId"
);
});
b1
.
OwnsOne
(
"PSManagement.Domain.Customers.ValueObjects.ContactNumber"
,
"PhoneNumber"
,
b2
=>
{
b2
.
Property
<
int
>(
"ContactInfoCustomerId"
)
.
HasColumnType
(
"int"
);
b2
.
Property
<
int
>(
"ContactInfoId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b2
.
Property
<
int
>(
"Number"
)
.
HasColumnType
(
"int"
);
b2
.
HasKey
(
"ContactInfoCustomerId"
,
"ContactInfoId"
);
b2
.
ToTable
(
"ContactInfo"
);
b2
.
WithOwner
()
.
HasForeignKey
(
"ContactInfoCustomerId"
,
"ContactInfoId"
);
});
b1
.
Navigation
(
"MobileNumber"
);
b1
.
Navigation
(
"PhoneNumber"
);
});
});
b
.
OwnsOne
(
"PSManagement.Domain.Customers.ValueObjects.Address"
,
"Address"
,
b1
=>
b
.
OwnsOne
(
"PSManagement.Domain.Customers.ValueObjects.Address"
,
"Address"
,
b1
=>
...
@@ -135,16 +95,20 @@ namespace PSManagement.Infrastructure.Persistence.Migrations
...
@@ -135,16 +95,20 @@ namespace PSManagement.Infrastructure.Persistence.Migrations
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b1
.
Property
<
string
>(
"City"
)
b1
.
Property
<
string
>(
"City"
)
.
HasColumnType
(
"nvarchar(max)"
);
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"City"
);
b1
.
Property
<
string
>(
"StreetName"
)
b1
.
Property
<
string
>(
"StreetName"
)
.
HasColumnType
(
"nvarchar(max)"
);
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"StreetName"
);
b1
.
Property
<
int
>(
"StreetNumber"
)
b1
.
Property
<
int
>(
"StreetNumber"
)
.
HasColumnType
(
"int"
);
.
HasColumnType
(
"int"
)
.
HasColumnName
(
"StreetNumber"
);
b1
.
Property
<
int
>(
"ZipCode"
)
b1
.
Property
<
int
>(
"ZipCode"
)
.
HasColumnType
(
"int"
);
.
HasColumnType
(
"int"
)
.
HasColumnName
(
"ZipCode"
);
b1
.
HasKey
(
"CustomerId"
);
b1
.
HasKey
(
"CustomerId"
);
...
...
PSManagement.Infrastructure.Persistence/PSManagement.Infrastructure.Persistence.csproj
View file @
804e6ccf
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
</PropertyGroup>
<ItemGroup>
<Folder Include="EntitiesConfiguration\" />
</ItemGroup>
<ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.17">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.17">
...
...
PSManagement.SharedKernel/DomainEvents/IDomainEvent.cs
View file @
804e6ccf
...
@@ -5,7 +5,7 @@ namespace PSManagement.SharedKernel.Events
...
@@ -5,7 +5,7 @@ namespace PSManagement.SharedKernel.Events
{
{
public
interface
IDomainEvent
:
INotification
public
interface
IDomainEvent
:
INotification
{
{
public
DateTime
DateOccurred
{
get
;
set
;
}
//
public DateTime DateOccurred { get; set; }
}
}
}
}
PSManagement.SharedKernel/DomainEvents/IDomainEventHandler.cs
0 → 100644
View file @
804e6ccf
using
MediatR
;
using
PSManagement.SharedKernel.Events
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
PSManagement.SharedKernel.DomainEvents
{
public
interface
IDomainEventHandler
<
T
>
:
INotificationHandler
<
T
>
where
T
:
IDomainEvent
{
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment