FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
InvvardDev.IFTTT.NET/src/Services/ProcessorRepository.cs at develop · Invvard/InvvardDev.IFTTT.NET · GitHub
Invvard
InvvardDev.IFTTT.NET
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
InvvardDev.IFTTT.NET
/
src
/
Services
/
ProcessorRepository.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
38 lines (27 loc) · 1.17 KB
Breadcrumbs
InvvardDev.IFTTT.NET
/
src
/
Services
/
ProcessorRepository.cs
Copy path
File metadata and controls
38 lines (27 loc) · 1.17 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using
InvvardDev
.
Ifttt
.
Contracts
;
using
InvvardDev
.
Ifttt
.
Models
.
Trigger
;
namespace
InvvardDev
.
Ifttt
.
Services
;
internal
class
ProcessorRepository
:
IProcessorRepository
{
private
readonly
Dictionary
<
string
,
ProcessorTree
>
processors
=
new
(
)
;
public
Task
AddProcessor
(
ProcessorTree
processorTree
)
{
processors
.
Add
(
processorTree
.
Key
,
processorTree
)
;
return
Task
.
CompletedTask
;
}
public
Task
UpdateProcessor
(
ProcessorTree
processorTree
)
{
processors
[
processorTree
.
Key
]
=
processorTree
;
return
Task
.
CompletedTask
;
}
public
Task
<
bool
>
Exists
(
string
key
)
=>
Task
.
FromResult
(
processors
.
ContainsKey
(
key
)
)
;
public
Task
<
ProcessorTree
?
>
GetProcessorByKey
(
string
key
)
=>
Task
.
FromResult
(
processors
.
GetValueOrDefault
(
key
)
)
;
public
Task
<
IEnumerable
<
ProcessorTree
>
>
FilterProcessors
(
Func
<
ProcessorTree
,
bool
>
predicate
)
=>
Task
.
FromResult
(
GetProcessorsTrees
(
)
.
Where
(
predicate
)
)
;
public
Task
<
IEnumerable
<
ProcessorTree
>
>
GetAllProcessors
(
)
=>
Task
.
FromResult
(
GetProcessorsTrees
(
)
)
;
private
IEnumerable
<
ProcessorTree
>
GetProcessorsTrees
(
)
=>
processors
.
Select
(
p
=>
p
.
Value
)
;
}
Back
|
FazBrowse Home
|
New Git URL