Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
CAP
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
tsai
CAP
Commits
fb8745ca
Commit
fb8745ca
authored
Jun 24, 2017
by
yangxiaodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update samples.
parent
1d3692d4
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
164 additions
and
51 deletions
+164
-51
AppDbContext.cs
samples/Sample.Kafka/AppDbContext.cs
+10
-4
20170622091105_CreateInit.cs
samples/Sample.Kafka/Migrations/20170622091105_CreateInit.cs
+0
-35
20170624095008_CreateDatabase.Designer.cs
...afka/Migrations/20170624095008_CreateDatabase.Designer.cs
+67
-0
20170624095008_CreateDatabase.cs
.../Sample.Kafka/Migrations/20170624095008_CreateDatabase.cs
+55
-0
AppDbContextModelSnapshot.cs
samples/Sample.Kafka/Migrations/AppDbContextModelSnapshot.cs
+32
-10
Sample.Kafka.csproj
samples/Sample.Kafka/Sample.Kafka.csproj
+0
-2
No files found.
samples/Sample.Kafka/AppDbContext.cs
View file @
fb8745ca
...
@@ -11,14 +11,20 @@ namespace Sample.Kafka
...
@@ -11,14 +11,20 @@ namespace Sample.Kafka
public
class
AppDbContext
:
DbContext
public
class
AppDbContext
:
DbContext
{
{
public
DbSet
<
C
onsistencyMessage
>
Messages
{
get
;
set
;
}
public
DbSet
<
C
apSentMessage
>
Sent
Messages
{
get
;
set
;
}
protected
override
void
OnConfiguring
(
DbContextOptionsBuilder
optionsBuilder
)
{
public
DbSet
<
CapReceivedMessage
>
ReceivedMessages
{
get
;
set
;
}
protected
override
void
OnConfiguring
(
DbContextOptionsBuilder
optionsBuilder
)
{
optionsBuilder
.
UseSqlServer
(
"Server=192.168.2.206;Initial Catalog=Test;User Id=cmswuliu;Password=h7xY81agBn*Veiu3;MultipleActiveResultSets=True"
);
optionsBuilder
.
UseSqlServer
(
"Server=192.168.2.206;Initial Catalog=Test;User Id=cmswuliu;Password=h7xY81agBn*Veiu3;MultipleActiveResultSets=True"
);
}
}
protected
override
void
OnModelCreating
(
ModelBuilder
modelBuilder
)
{
protected
override
void
OnModelCreating
(
ModelBuilder
modelBuilder
)
modelBuilder
.
Entity
<
ConsistencyMessage
>().
Property
(
x
=>
x
.
RowVersion
).
IsConcurrencyToken
();
{
modelBuilder
.
Entity
<
CapSentMessage
>().
Property
(
x
=>
x
.
StateName
).
HasMaxLength
(
50
);
modelBuilder
.
Entity
<
CapReceivedMessage
>().
Property
(
x
=>
x
.
StateName
).
HasMaxLength
(
50
);
base
.
OnModelCreating
(
modelBuilder
);
base
.
OnModelCreating
(
modelBuilder
);
}
}
}
}
...
...
samples/Sample.Kafka/Migrations/20170622091105_CreateInit.cs
deleted
100644 → 0
View file @
1d3692d4
using
System
;
using
System.Collections.Generic
;
using
Microsoft.EntityFrameworkCore.Migrations
;
namespace
Sample.Kafka.Migrations
{
public
partial
class
CreateInit
:
Migration
{
protected
override
void
Up
(
MigrationBuilder
migrationBuilder
)
{
migrationBuilder
.
CreateTable
(
name
:
"Messages"
,
columns
:
table
=>
new
{
Id
=
table
.
Column
<
string
>(
nullable
:
false
),
Payload
=
table
.
Column
<
string
>(
nullable
:
true
),
RowVersion
=
table
.
Column
<
byte
[
]>
(
nullable
:
true
),
SendTime
=
table
.
Column
<
DateTime
>(
nullable
:
false
),
Status
=
table
.
Column
<
int
>(
nullable
:
false
),
Topic
=
table
.
Column
<
string
>(
nullable
:
true
),
UpdateTime
=
table
.
Column
<
DateTime
>(
nullable
:
true
)
},
constraints
:
table
=>
{
table
.
PrimaryKey
(
"PK_Messages"
,
x
=>
x
.
Id
);
});
}
protected
override
void
Down
(
MigrationBuilder
migrationBuilder
)
{
migrationBuilder
.
DropTable
(
name
:
"Messages"
);
}
}
}
samples/Sample.Kafka/Migrations/2017062
2091105_CreateInit
.Designer.cs
→
samples/Sample.Kafka/Migrations/2017062
4095008_CreateDatabase
.Designer.cs
View file @
fb8745ca
...
@@ -4,13 +4,12 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
...
@@ -4,13 +4,12 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
using
Microsoft.EntityFrameworkCore.Metadata
;
using
Microsoft.EntityFrameworkCore.Metadata
;
using
Microsoft.EntityFrameworkCore.Migrations
;
using
Microsoft.EntityFrameworkCore.Migrations
;
using
Sample.Kafka
;
using
Sample.Kafka
;
using
DotNetCore.CAP.Infrastructure
;
namespace
Sample.Kafka.Migrations
namespace
Sample.Kafka.Migrations
{
{
[
DbContext
(
typeof
(
AppDbContext
))]
[
DbContext
(
typeof
(
AppDbContext
))]
[
Migration
(
"2017062
2091105_CreateInit
"
)]
[
Migration
(
"2017062
4095008_CreateDatabase
"
)]
partial
class
Create
Init
partial
class
Create
Database
{
{
protected
override
void
BuildTargetModel
(
ModelBuilder
modelBuilder
)
protected
override
void
BuildTargetModel
(
ModelBuilder
modelBuilder
)
{
{
...
@@ -18,27 +17,50 @@ namespace Sample.Kafka.Migrations
...
@@ -18,27 +17,50 @@ namespace Sample.Kafka.Migrations
.
HasAnnotation
(
"ProductVersion"
,
"1.1.2"
)
.
HasAnnotation
(
"ProductVersion"
,
"1.1.2"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
modelBuilder
.
Entity
(
"DotNetCore.CAP.Infrastructure.C
onsistency
Message"
,
b
=>
modelBuilder
.
Entity
(
"DotNetCore.CAP.Infrastructure.C
apReceived
Message"
,
b
=>
{
{
b
.
Property
<
string
>(
"Id"
)
b
.
Property
<
string
>(
"Id"
)
.
ValueGeneratedOnAdd
();
.
ValueGeneratedOnAdd
();
b
.
Property
<
string
>(
"Payloa
d"
);
b
.
Property
<
DateTime
>(
"Adde
d"
);
b
.
Property
<
byte
[
]>
(
"RowVersion"
)
b
.
Property
<
string
>(
"Content"
);
.
IsConcurrencyToken
();
b
.
Property
<
DateTime
>(
"SendTi
me"
);
b
.
Property
<
string
>(
"KeyNa
me"
);
b
.
Property
<
int
>(
"Status
"
);
b
.
Property
<
DateTime
>(
"LastRun
"
);
b
.
Property
<
string
>(
"Topic
"
);
b
.
Property
<
int
>(
"Retries
"
);
b
.
Property
<
DateTime
?>(
"UpdateTime"
);
b
.
Property
<
string
>(
"StateName"
)
.
HasMaxLength
(
50
);
b
.
HasKey
(
"Id"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"Messages"
);
b
.
ToTable
(
"ReceivedMessages"
);
});
modelBuilder
.
Entity
(
"DotNetCore.CAP.Infrastructure.CapSentMessage"
,
b
=>
{
b
.
Property
<
string
>(
"Id"
)
.
ValueGeneratedOnAdd
();
b
.
Property
<
DateTime
>(
"Added"
);
b
.
Property
<
string
>(
"Content"
);
b
.
Property
<
string
>(
"KeyName"
);
b
.
Property
<
DateTime
>(
"LastRun"
);
b
.
Property
<
int
>(
"Retries"
);
b
.
Property
<
string
>(
"StateName"
)
.
HasMaxLength
(
50
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"SentMessages"
);
});
});
}
}
}
}
...
...
samples/Sample.Kafka/Migrations/20170624095008_CreateDatabase.cs
0 → 100644
View file @
fb8745ca
using
System
;
using
System.Collections.Generic
;
using
Microsoft.EntityFrameworkCore.Migrations
;
namespace
Sample.Kafka.Migrations
{
public
partial
class
CreateDatabase
:
Migration
{
protected
override
void
Up
(
MigrationBuilder
migrationBuilder
)
{
migrationBuilder
.
CreateTable
(
name
:
"ReceivedMessages"
,
columns
:
table
=>
new
{
Id
=
table
.
Column
<
string
>(
nullable
:
false
),
Added
=
table
.
Column
<
DateTime
>(
nullable
:
false
),
Content
=
table
.
Column
<
string
>(
nullable
:
true
),
KeyName
=
table
.
Column
<
string
>(
nullable
:
true
),
LastRun
=
table
.
Column
<
DateTime
>(
nullable
:
false
),
Retries
=
table
.
Column
<
int
>(
nullable
:
false
),
StateName
=
table
.
Column
<
string
>(
maxLength
:
50
,
nullable
:
true
)
},
constraints
:
table
=>
{
table
.
PrimaryKey
(
"PK_ReceivedMessages"
,
x
=>
x
.
Id
);
});
migrationBuilder
.
CreateTable
(
name
:
"SentMessages"
,
columns
:
table
=>
new
{
Id
=
table
.
Column
<
string
>(
nullable
:
false
),
Added
=
table
.
Column
<
DateTime
>(
nullable
:
false
),
Content
=
table
.
Column
<
string
>(
nullable
:
true
),
KeyName
=
table
.
Column
<
string
>(
nullable
:
true
),
LastRun
=
table
.
Column
<
DateTime
>(
nullable
:
false
),
Retries
=
table
.
Column
<
int
>(
nullable
:
false
),
StateName
=
table
.
Column
<
string
>(
maxLength
:
50
,
nullable
:
true
)
},
constraints
:
table
=>
{
table
.
PrimaryKey
(
"PK_SentMessages"
,
x
=>
x
.
Id
);
});
}
protected
override
void
Down
(
MigrationBuilder
migrationBuilder
)
{
migrationBuilder
.
DropTable
(
name
:
"ReceivedMessages"
);
migrationBuilder
.
DropTable
(
name
:
"SentMessages"
);
}
}
}
samples/Sample.Kafka/Migrations/AppDbContextModelSnapshot.cs
View file @
fb8745ca
...
@@ -4,7 +4,6 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
...
@@ -4,7 +4,6 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
using
Microsoft.EntityFrameworkCore.Metadata
;
using
Microsoft.EntityFrameworkCore.Metadata
;
using
Microsoft.EntityFrameworkCore.Migrations
;
using
Microsoft.EntityFrameworkCore.Migrations
;
using
Sample.Kafka
;
using
Sample.Kafka
;
using
DotNetCore.CAP.Infrastructure
;
namespace
Sample.Kafka.Migrations
namespace
Sample.Kafka.Migrations
{
{
...
@@ -17,27 +16,50 @@ namespace Sample.Kafka.Migrations
...
@@ -17,27 +16,50 @@ namespace Sample.Kafka.Migrations
.
HasAnnotation
(
"ProductVersion"
,
"1.1.2"
)
.
HasAnnotation
(
"ProductVersion"
,
"1.1.2"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
modelBuilder
.
Entity
(
"DotNetCore.CAP.Infrastructure.C
onsistency
Message"
,
b
=>
modelBuilder
.
Entity
(
"DotNetCore.CAP.Infrastructure.C
apReceived
Message"
,
b
=>
{
{
b
.
Property
<
string
>(
"Id"
)
b
.
Property
<
string
>(
"Id"
)
.
ValueGeneratedOnAdd
();
.
ValueGeneratedOnAdd
();
b
.
Property
<
string
>(
"Payloa
d"
);
b
.
Property
<
DateTime
>(
"Adde
d"
);
b
.
Property
<
byte
[
]>
(
"RowVersion"
)
b
.
Property
<
string
>(
"Content"
);
.
IsConcurrencyToken
();
b
.
Property
<
DateTime
>(
"SendTi
me"
);
b
.
Property
<
string
>(
"KeyNa
me"
);
b
.
Property
<
int
>(
"Status
"
);
b
.
Property
<
DateTime
>(
"LastRun
"
);
b
.
Property
<
string
>(
"Topic
"
);
b
.
Property
<
int
>(
"Retries
"
);
b
.
Property
<
DateTime
?>(
"UpdateTime"
);
b
.
Property
<
string
>(
"StateName"
)
.
HasMaxLength
(
50
);
b
.
HasKey
(
"Id"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"Messages"
);
b
.
ToTable
(
"ReceivedMessages"
);
});
modelBuilder
.
Entity
(
"DotNetCore.CAP.Infrastructure.CapSentMessage"
,
b
=>
{
b
.
Property
<
string
>(
"Id"
)
.
ValueGeneratedOnAdd
();
b
.
Property
<
DateTime
>(
"Added"
);
b
.
Property
<
string
>(
"Content"
);
b
.
Property
<
string
>(
"KeyName"
);
b
.
Property
<
DateTime
>(
"LastRun"
);
b
.
Property
<
int
>(
"Retries"
);
b
.
Property
<
string
>(
"StateName"
)
.
HasMaxLength
(
50
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"SentMessages"
);
});
});
}
}
}
}
...
...
samples/Sample.Kafka/Sample.Kafka.csproj
View file @
fb8745ca
...
@@ -5,8 +5,6 @@
...
@@ -5,8 +5,6 @@
</PropertyGroup>
</PropertyGroup>
<ItemGroup>
<ItemGroup>
<Folder Include="Migrations\" />
<Folder Include="Migrations\" />
<Folder Include="wwwroot\" />
<Folder Include="wwwroot\" />
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
...
...
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