Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SEP-2024-team-D
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nahodil, Petr
SEP-2024-team-D
Commits
314f16e1
Commit
314f16e1
authored
3 months ago
by
Nahodil, Petr
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
c5f466fe
f6276748
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
FlightLogNet/InjectConfiguration.cs
+2
-2
2 additions, 2 deletions
FlightLogNet/InjectConfiguration.cs
FlightLogNet/Integration/ClubUserDatabase.cs
+21
-4
21 additions, 4 deletions
FlightLogNet/Integration/ClubUserDatabase.cs
with
23 additions
and
6 deletions
FlightLogNet/InjectConfiguration.cs
+
2
−
2
View file @
314f16e1
...
...
@@ -25,8 +25,8 @@
services
.
AddScoped
<
PersonFacade
,
PersonFacade
>();
services
.
AddScoped
<
FlightFacade
,
FlightFacade
>();
services
.
AddScoped
<
IClubUserDatabase
,
ClubUserDatabaseStub
>();
//
services.AddScoped<IClubUserDatabase, ClubUserDatabase>();
//
services.AddScoped<IClubUserDatabase, ClubUserDatabaseStub>();
services
.
AddScoped
<
IClubUserDatabase
,
ClubUserDatabase
>();
}
}
}
This diff is collapsed.
Click to expand it.
FlightLogNet/Integration/ClubUserDatabase.cs
+
21
−
4
View file @
314f16e1
namespace
FlightLogNet.Integration
using
System
;
using
RestSharp
;
namespace
FlightLogNet.Integration
{
using
System.Collections.Generic
;
using
System.Linq
;
...
...
@@ -29,13 +32,27 @@
private
List
<
ClubUser
>
ReceiveClubUsers
()
{
// TODO 8.2: Naimplementujte volání endpointu ClubDB pomocí RestSharp
return
null
;
string
baseUrl
=
configuration
[
"ClubUsersApi"
];
// Retrieve the base URL from configuration
// Check if baseUrl is null or empty before using it
if
(
string
.
IsNullOrWhiteSpace
(
baseUrl
))
{
throw
new
InvalidOperationException
(
"Base URL for 'ClubUsersApi' is not configured or is empty."
);
}
var
client
=
new
RestClient
(
baseUrl
);
var
request
=
new
RestRequest
(
"club/user"
);
var
response
=
client
.
Get
<
List
<
ClubUser
>>(
request
);
return
response
;
}
private
List
<
PersonModel
>
TransformToPersonModel
(
IList
<
ClubUser
>
users
)
{
return
null
;
return
users
.
Select
(
user
=>
new
PersonModel
{
MemberId
=
user
.
MemberId
,
FirstName
=
user
.
FirstName
,
LastName
=
user
.
LastName
,
}).
ToList
();
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment