private async Task <ProfileViewModel> GetProfileViewModelAsync(Profile profile) { var result = _mapper.Map <ProfileViewModel>(profile); result.Images = (await _profileRepository.GetProfileImages(profile)).Select(i => i.Id); return(result); }
// [EnableCors("AllowAll")] public async Task <IActionResult> CreateProfile([FromBody] Models.Profile item) { if (item == null) { return(BadRequest()); } ApplicationDbContext.Profiles.Add(item); await ApplicationDbContext.SaveChangesAsync(); return(this.CreatedAtRoute("GetProfileById", new { Controller = "ProfilesController", profileId = item.Id }, item)); }