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
f92d8edf
Commit
f92d8edf
authored
Dec 23, 2018
by
Clint.Network
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add GetPlayers() Method
parent
59a36644
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
IParticipations.cs
Stratis.Guru/Models/IParticipations.cs
+3
-0
Participations.cs
Stratis.Guru/Models/Participations.cs
+5
-0
No files found.
Stratis.Guru/Models/IParticipations.cs
View file @
f92d8edf
using
System.Collections.Generic
;
namespace
Stratis.Guru.Models
namespace
Stratis.Guru.Models
{
{
public
interface
IParticipation
public
interface
IParticipation
{
{
void
StoreParticipation
(
string
ticket
,
string
nickname
,
string
address
);
void
StoreParticipation
(
string
ticket
,
string
nickname
,
string
address
);
List
<
string
>
GetPlayers
(
string
draw
);
}
}
}
}
\ No newline at end of file
Stratis.Guru/Models/Participations.cs
View file @
f92d8edf
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
MongoDB.Driver
;
namespace
Stratis.Guru.Models
namespace
Stratis.Guru.Models
{
{
...
@@ -13,6 +16,8 @@ namespace Stratis.Guru.Models
...
@@ -13,6 +16,8 @@ namespace Stratis.Guru.Models
_draws
=
draws
;
_draws
=
draws
;
}
}
public
List
<
string
>
GetPlayers
(
string
draw
)
=>
_databaseContext
.
Participations
.
Find
(
x
=>
x
.
Draw
.
Equals
(
draw
)).
ToList
().
Select
(
x
=>
x
.
Nickname
).
Distinct
().
ToList
();
public
void
StoreParticipation
(
string
ticket
,
string
nickname
,
string
address
)
public
void
StoreParticipation
(
string
ticket
,
string
nickname
,
string
address
)
{
{
_databaseContext
.
Participations
.
InsertOne
(
new
Participation
_databaseContext
.
Participations
.
InsertOne
(
new
Participation
...
...
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