Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Group17ProfileMicroservice
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Asif, Adiv (UG - Comp Sci & Elec Eng)
Group17ProfileMicroservice
Commits
77d04d69
Commit
77d04d69
authored
2 years ago
by
Adiv
Browse files
Options
Downloads
Patches
Plain Diff
Fixups
parent
1daef41b
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
Group17profile.csproj
+5
-5
5 additions, 5 deletions
Group17profile.csproj
Services/ProfileService.cs
+6
-3
6 additions, 3 deletions
Services/ProfileService.cs
with
11 additions
and
8 deletions
Group17profile.csproj
+
5
−
5
View file @
77d04d69
...
...
@@ -11,16 +11,16 @@
<PackageReference Include="AutoMapper" Version="12.0.1" />
<PackageReference Include="Azure.Storage.Blobs" Version="12.16.0-beta.1" />
<PackageReference Include="Azure.Storage.Common" Version="12.15.0-beta.1" />
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="
8
.0.
0-preview.2.23153.2
" />
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="
7
.0.
5
" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.4" />
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.32.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="
8
.0.
0-preview.2.23128.3
" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="
8
.0.
0-preview.2.23128.3
">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="
7
.0.
5
" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="
7
.0.
5
">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="
8
.0.
0-preview.2.23128.3
" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="
8
.0.
0-preview.2.23128.3
">
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="
7
.0.
5
" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="
7
.0.
5
">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
...
...
This diff is collapsed.
Click to expand it.
Services/ProfileService.cs
+
6
−
3
View file @
77d04d69
...
...
@@ -40,13 +40,12 @@ public class ProfileService : IProfileService
if
(
age
is
<=
16
or
>=
100
)
throw
new
ProfileException
(
"Please enter valid age."
);
var
newDetails
=
_mapper
.
Map
<
Profile
>(
profile
);
var
record
=
_mapper
.
Map
<
Profile
>(
profile
);
if
(
!
string
.
IsNullOrWhiteSpace
(
newDeta
il
s
.
FavouriteShows
)
)
if
(
profile
.
FavouriteShows
!=
null
&&
prof
il
e
.
FavouriteShows
.
Count
!=
0
)
{
var
builder
=
new
StringBuilder
();
foreach
(
var
show
in
newDeta
il
s
.
FavouriteShows
)
foreach
(
var
show
in
prof
il
e
.
FavouriteShows
)
builder
.
Append
(
$"
{
show
}
,"
);
record
.
FavouriteShows
=
builder
.
ToString
();
...
...
@@ -55,6 +54,8 @@ public class ProfileService : IProfileService
if
(
user
.
ProfileId
==
null
)
{
var
newProfile
=
await
_profileRepository
.
CreateAndSaveAsync
(
record
);
user
.
ProfileId
=
newProfile
.
Id
;
await
_userRepository
.
UpdateAndSaveAsync
(
user
);
return
_mapper
.
Map
<
ProfileDTO
>(
newProfile
);
}
...
...
@@ -96,6 +97,8 @@ public class ProfileService : IProfileService
BannerUrl
=
image
.
ToString
()
};
await
_profileRepository
.
CreateAndSaveAsync
(
newProfile
);
user
.
ProfileId
=
newProfile
.
Id
;
await
_userRepository
.
UpdateAndSaveAsync
(
user
);
return
_storageService
.
GetSasForFile
(
Constants
.
AzureBlobContainer
.
BannerPictures
,
image
.
ToString
());
}
...
...
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