public async Task <AccountSubscriptionModelApi <int> > SubscribeUserAsync(int subscriptionId, IIdentity identity) { var user = await this._accountRepository.GetByIdAsync(Int32.Parse(identity.Name)); var rootFolder = await _rootFolderService.CreateRootFolderAsync(); AccountSubscriptionModelBussines <int> model = new AccountSubscriptionModelBussines <int>() { AccountId = user.Id, RootFolderId = rootFolder.Id, SubscriptionId = subscriptionId }; NotificationModelApi <int> notification = new NotificationModelApi <int>() { Descritpion = "You registered and signed in on Common subscription", NotificationState = SharedTypes.Enums.NotificationStateEnum.New, Title = "Welcome to the service" }; var mapped = AutoMapperConfig.Mapper.Map <NotificationModelBussines <int> >(notification); mapped.AccountId = user.Id; await this._notificationRepository.CreateAsync(mapped); await this._signalRCommunicationService.SendNotificationSignalR(notification, user.Id); return(AutoMapperConfig.Mapper.Map <AccountSubscriptionModelApi <int> >( await this._accountSubscriptionRepository.CreateAsync(model) )); }