Skip to content
Snippets Groups Projects
Commit fb6e18e8 authored by Adiv's avatar Adiv
Browse files

fixup again...

parent 77d04d69
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@ using System.Text;
using AutoMapper;
using Exceptions;
using Microsoft.EntityFrameworkCore;
using Models;
using Models.DTOs;
using Models.Entities;
using Repositories;
......@@ -41,6 +42,12 @@ public class ProfileService : IProfileService
throw new ProfileException("Please enter valid age.");
var record = _mapper.Map<Profile>(profile);
if (user.ProfileId != null)
{
var existingProfile = await _profileRepository.GetAll().AsNoTracking()
.FirstOrDefaultAsync(p => p.Id == user.ProfileId);
record.Id = existingProfile!.Id;
}
if (profile.FavouriteShows != null && profile.FavouriteShows.Count != 0)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment