public async Task <ProfileSettingsViewModel> SaveProfilePicture(string userId, IFormFile file) { using (var ms = new MemoryStream()) { await file.CopyToAsync(ms); var bytes = ms.ToArray(); var path = await _mediaStorageService.SaveMedia("/blog-media/profile/", file.FileName, bytes); _dataProvider.SaveProfilePicture(userId, path); return(GetProfileSettings(userId)); } }