Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
guru
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DeStream-public
guru
Commits
d42828d2
Commit
d42828d2
authored
Dec 23, 2018
by
Clint.Network
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add amount to participation and retrieve all Participation object
parent
4e0bc775
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
5 deletions
+7
-5
IParticipations.cs
Stratis.Guru/Models/IParticipations.cs
+2
-2
Participation.cs
Stratis.Guru/Models/Participation.cs
+1
-0
Participations.cs
Stratis.Guru/Models/Participations.cs
+4
-3
No files found.
Stratis.Guru/Models/IParticipations.cs
View file @
d42828d2
...
...
@@ -4,7 +4,7 @@ namespace Stratis.Guru.Models
{
public
interface
IParticipation
{
void
StoreParticipation
(
string
ticket
,
string
nickname
,
string
address
);
List
<
string
>
GetPlayers
(
string
draw
);
void
StoreParticipation
(
string
ticket
,
string
nickname
,
string
address
,
double
amount
);
List
<
Participation
>
GetPlayers
(
string
draw
);
}
}
\ No newline at end of file
Stratis.Guru/Models/Participation.cs
View file @
d42828d2
...
...
@@ -12,5 +12,6 @@ namespace Stratis.Guru.Models
public
BsonDateTime
CreationDate
{
get
;
set
;
}
public
string
Nickname
{
get
;
internal
set
;
}
public
string
Draw
{
get
;
internal
set
;
}
public
double
Amount
{
get
;
internal
set
;
}
}
}
\ No newline at end of file
Stratis.Guru/Models/Participations.cs
View file @
d42828d2
...
...
@@ -16,9 +16,9 @@ namespace Stratis.Guru.Models
_draws
=
draws
;
}
public
List
<
string
>
GetPlayers
(
string
draw
)
=>
_databaseContext
.
Participations
.
Find
(
x
=>
x
.
Draw
.
Equals
(
draw
)).
ToList
().
Select
(
x
=>
x
.
Nickname
).
Distinct
(
).
ToList
();
public
List
<
Participation
>
GetPlayers
(
string
draw
)
=>
_databaseContext
.
Participations
.
Find
(
x
=>
x
.
Draw
.
Equals
(
draw
)
).
ToList
();
public
void
StoreParticipation
(
string
ticket
,
string
nickname
,
string
address
)
public
void
StoreParticipation
(
string
ticket
,
string
nickname
,
string
address
,
double
amount
)
{
_databaseContext
.
Participations
.
InsertOne
(
new
Participation
{
...
...
@@ -26,7 +26,8 @@ namespace Stratis.Guru.Models
Ticket
=
ticket
,
Nickname
=
nickname
,
WithdrawAddress
=
address
,
Draw
=
_draws
.
GetLastDraw
()
Draw
=
_draws
.
GetLastDraw
(),
Amount
=
amount
});
}
}
...
...
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