当前位置: 首页>>代码示例>>C#>>正文


C# SystemSession.GetSession方法代码示例

本文整理汇总了C#中Model.Types.SystemSession.GetSession方法的典型用法代码示例。如果您正苦于以下问题:C# SystemSession.GetSession方法的具体用法?C# SystemSession.GetSession怎么用?C# SystemSession.GetSession使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Model.Types.SystemSession的用法示例。


在下文中一共展示了SystemSession.GetSession方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetInboxFolderRules

 public async Task<IEnumerable<RuleResponse>> GetInboxFolderRules(int? folderId, SystemSession session)
 {
     var response = new List<RuleResponse>();
     var inboxRuleList = await Task.Factory.StartNew(() => (folderId == null)
         ? Client.InboxRuleService.getRules(session.UserId, session.GetSession())
         : Client.InboxService.getInboxFolderWithRules(session.UserId, (int)folderId, session.GetSession())
             .InboxRules).ConfigureAwait(false);
     if (inboxRuleList != null)
     {
         inboxRuleList.ForEach(
             x =>
             {
                 if (x.RuleId > 0)
                     response.Add(new RuleResponse
                     {
                         FolderId = x.InboxId,
                         MessageRuleId = x.RuleId,
                         RuleTypeUser = (SystemRuleTypeUser)x.RuleTypeUser,
                         ContactList = x.ContactList,
                         GroupList = x.GroupList,
                         RuleTypeSubject = (SystemRuleTypeSubject)x.RuleTypeSubject,
                         Subject = x.Subject
                     });
             });
     }
     return response;
 }
开发者ID:tektak-abhisheksth,项目名称:Web-API,代码行数:27,代码来源:InboxRepository.cs

示例2: UpsertCategoryFriends

 public async Task<StatusData<string>> UpsertCategoryFriends(CategoryFriends request, SystemDbStatus mode, SystemSession session)
 {
     var userCategory = new UserCategory { UserId = session.UserId.ToString(), UserCategoryTypeId = request.CategoryId };
     var friends = request.Friends != null && request.Friends.Any() ? String.Join(",", request.Friends) : null;
     var result = (mode == SystemDbStatus.Inserted
                 ? await
                     Task.Factory.StartNew(
                         () => Client.UserService.insertInCategory(userCategory, friends, session.GetSession())).ConfigureAwait(false)
                 : await
                     Task.Factory.StartNew(
                         () => Client.UserService.removeFromCategory(userCategory, friends, session.GetSession())).ConfigureAwait(false));
     return result.GetStatusData<string>();
 }
开发者ID:tektak-abhisheksth,项目名称:Web-API,代码行数:13,代码来源:CategoryRepository.cs

示例3: ReCrop

 public async Task<StatusData<string>> ReCrop(ImageCropRequest cropRequest, SystemSession session)
 {
     var serviceCropRequest = new ElifImageCrop { Width = cropRequest.CropDetail.Width, Height = cropRequest.CropDetail.Height, Top = cropRequest.CropDetail.Top, Bottom = cropRequest.CropDetail.Bottom, Left = cropRequest.CropDetail.Left, Right = cropRequest.CropDetail.Right, SizeCodes = (SizedCodes)cropRequest.CropDetail.SizeCode };
     var response = await Task.Factory.StartNew(() => Client.ElifService.reCrop(cropRequest.FileId, serviceCropRequest, session.GetSession())).ConfigureAwait(false);
     var result = new StatusData<string> { Status = response ? SystemDbStatus.Updated : SystemDbStatus.NotModified };
     return result;
 }
开发者ID:tektak-abhisheksth,项目名称:Web-API,代码行数:7,代码来源:MediaRepository.cs

示例4: UserSearch

        public async Task<UserSearchResponse> UserSearch(UserSearchRequest request, SystemSession session)
        {
            var serviceRequest = new UserSearchQuery
            {
                Query = request.Query,
                Cursor = request.Cursor,
                Limit = request.Limit
            };

            var response = await Task.Factory.StartNew(() => Client.SearchService.userSearch(serviceRequest, session.GetSession())).ConfigureAwait(false);

            var result = new UserSearchResponse
            {
                Cursor = response.Cursor,
                Limit = response.Limit,
                Count = response.Count,

                User = response.Users != null ? response.Users.Select(x => new UserInformationBaseExtendedResponse
                {
                    FirstName = x.UserInfoPerson.FirstName,
                    LastName = x.UserInfoPerson.LastName,
                    Image = x.UserInfo.Picture,
                    Title = x.UserInfo.Title,
                    UserId = Convert.ToInt32(x.UserInfoPerson.UserId),
                    UserName = x.UserName,
                    UserTypeId = (SystemUserType)x.UserInfo.UserTypeId
                }) : null
            };
            return result;
        }
开发者ID:tektak-abhisheksth,项目名称:Web-API,代码行数:30,代码来源:SearchRepository.cs

示例5: GetProfileInformation

        public virtual async Task<PersonalProfileResponse> GetProfileInformation(string targetUser,
            SystemSession session)
        {
            var serviceResponse =
                await
                    Task.Factory.StartNew(
                        () => Client.UserService.getProfile(session.UserId, 0, targetUser, session.GetSession()))
                        .ConfigureAwait(false);

            var response = new PersonalProfileResponse
            {
                BasicInformation = new BasicInformation
                {
                    UserId = Convert.ToInt32(serviceResponse.User.UserId),
                    UserName = serviceResponse.User.UserName,
                    UserTypeId = (SystemUserType)serviceResponse.UserInfo.UserTypeId,
                    Email = serviceResponse.User.Email,
                    FirstName = serviceResponse.UserInfoPerson.FirstName,
                    LastName = serviceResponse.UserInfoPerson.LastName,
                    FriendShipStatus = (SystemFriendshipStatus)serviceResponse.FriendshipStatus,
                    //(SystemFriendshipStatus)await Task.Factory.StartNew(() => _client.UserService.getFriendShipStatus(userId, targetUser, session.GetSession())),
                    PrimaryContactNumber = serviceResponse.User.PrimaryContactNumber,
                    Image = serviceResponse.UserInfo.Picture,
                    //ImageService.GetProfilePhoto(serviceResponse.UserInfo, (SystemImageSize)systemImageSize),
                    AvailableStatus = (SystemUserAvailabilityCode)Convert.ToByte(serviceResponse.User.ChatStatus),
                    Title = serviceResponse.UserInfoPerson.Title,
                    LastUpdated =
                        Convert.ToInt64(
                            (Convert.ToDateTime(serviceResponse.LastUpdated) - new DateTime(1970, 1, 1))
                                .TotalMilliseconds)
                }
            };
            return response;
        }
开发者ID:tektak-abhisheksth,项目名称:Web-API,代码行数:34,代码来源:ProfileRepository.cs

示例6: GetProfileViewSummary

        public async Task<PaginatedResponseExtended<IEnumerable<ViewSummaryResponse>, int>> GetProfileViewSummary(PaginatedRequest<int> request, SystemSession session)
        {
            var serviceRequest = new ProfileView
            {
                UserId = request.UserId,
                ViewType = request.Data,
                PageIndex = request.PageIndex,
                PageSize = request.PageSize
            };

            var response = await Task.Factory.StartNew(() => Client.UserService.profileViewSummary(serviceRequest, session.GetSession())).ConfigureAwait(false);
            var data = response.ProfileViews.Select(x => new ViewSummaryResponse
            {
                TypeId = x.TypeId,
                Name = x.FirstName,
                ViewCount = x.ViewersCount,
                NewViewCount = x.NewViews,
                LastViewed = Convert.ToDateTime(x.ViewDate)
            });
            var result = new PaginatedResponseExtended<IEnumerable<ViewSummaryResponse>, int>
            {
                Page = data,
                HasNextPage = response.HasNextPage,
                Information = response.ViewCount
            };
            return result;
        }
开发者ID:tektak-abhisheksth,项目名称:Web-API,代码行数:27,代码来源:ProfileRepositorySealed.cs

示例7: GetCompanyReviews

        public async Task<PaginatedResponse<IEnumerable<CompanyReviewResponse>>> GetCompanyReviews(SingleData<int> request, int pageIndex, int pageSize, SystemSession session)
        {
            var serviceRequest = new CompanyReview
            {
                CompanyId = request.Data,
                OffSet = pageIndex,
                PageSize = pageSize

            };
            var response = await Task.Factory.StartNew(() => Client.UserService.getCompanyReviews(serviceRequest, session.GetSession())).ConfigureAwait(false);
            var result = new PaginatedResponse<IEnumerable<CompanyReviewResponse>>
            {
                HasNextPage = response.HasNextPage,
                Page = response.CompanyReviews.Select(
                 x => new CompanyReviewResponse
                 {
                     CompanyReviewGuid = x.CompanyReviewGUID != null ? Guid.Parse(x.CompanyReviewGUID) : Guid.Empty,
                     User = new UserResponse
                     {
                         UserId = x.UserId,
                         UserName = x.Username,
                         Name = x.Name,
                         Picture = x.PictureUrl
                     },
                     Star = x.Star,
                     Title = x.Title,
                     Comment = x.Comment,
                     DateCommented = x.DateCommented != null ? Convert.ToDateTime(x.DateCommented) : (DateTime?)null,
                     IsApproved = x.IsApproved
                 })

            };
            return result;
        }
开发者ID:tektak-abhisheksth,项目名称:Web-API,代码行数:34,代码来源:ProfileBusinessRepositorySealed.cs

示例8: GetUrl

 public async Task<string> GetUrl(ImageRequest request, SystemSession session)
 {
     var serviceRequest = new Elif { FileId = request.FileId, AskWebp = request.AskWebp, IsProfilePic = request.IsProfilePicture, SizeCodes = (SizedCodes)request.SizeCode, Username = request.UserName };
     var response = await Task.Factory.StartNew(() => Client.ElifService.getUrl(serviceRequest, session.GetSession())).ConfigureAwait(false);
     //  return string.IsNullOrWhiteSpace(response) ? null : response;
     return response;
 }
开发者ID:tektak-abhisheksth,项目名称:Web-API,代码行数:7,代码来源:MediaRepository.cs

示例9: DeleteFiles

 public async Task<List<string>> DeleteFiles(SingleData<List<string>> request, SystemSession session)
 {
     var serviceRequest = new List<Elif>();
     request.Data.ForEach(x => serviceRequest.Add(new Elif { FileId = x, Username = session.UserName }));
     var response = await Task.Factory.StartNew(() => Client.ElifService.deleteFiles(serviceRequest, session.GetSession())).ConfigureAwait(false);
     return response;
 }
开发者ID:tektak-abhisheksth,项目名称:Web-API,代码行数:7,代码来源:MediaRepository.cs

示例10: GetMessageCount

 public async Task<StatusData<int>> GetMessageCount(SystemSession session)
 {
     var result = new StatusData<int>();
     var response = await Task.Factory.StartNew(() => Client.NotificationService.messageCount(session.GetSession())).ConfigureAwait(false);
     result.Data = response;
     return result;
 }
开发者ID:tektak-abhisheksth,项目名称:Web-API,代码行数:7,代码来源:NotificationRepository.cs

示例11: GetMutualFriends

        public async Task<PaginatedResponseExtended<IEnumerable<UserInformationBaseExtendedResponse>, int>> GetMutualFriends(PaginatedRequest<string> request, SystemSession session)
        {
            var serviceRequest = new MutualFriend
            {
                UserId = session.UserId,
                TargetType = "F",
                TargetUser = request.Data,
                PageIndex = request.PageIndex,
                PageSize = request.PageSize
            };

            var data = await Task.Factory.StartNew(() => Client.UserService.getMutualFriends(serviceRequest, session.GetSession())).ConfigureAwait(false);
            var result = new PaginatedResponseExtended<IEnumerable<UserInformationBaseExtendedResponse>, int>
            {
                Page = data.MutualFriends.Select(x => new UserInformationBaseExtendedResponse
                {
                    UserId = x.UserId,
                    UserName = x.UserName,
                    UserTypeId = (SystemUserType)x.UserTypeId,
                    FirstName = x.FirstName,
                    LastName = x.LastName,
                    Image = x.Picture,
                    Title = x.Title
                }),
                HasNextPage = data.HasNextPage,
                Information = data.Count
            };

            return result;
        }
开发者ID:tektak-abhisheksth,项目名称:Web-API,代码行数:30,代码来源:FriendRepositorySealed.cs

示例12: GetFriendsInCategory

        public async Task<PaginatedResponse<IEnumerable<FriendsInCategoryResponse>>> GetFriendsInCategory(PaginatedRequest<FriendsInCategoryRequest> request, SystemSession session)
        {
            var serviceRequest = new UserCategory
            {
                UserId = session.UserId.ToString(),
                UserCategoryTypeId = request.Data.CategoryId,
                InvertCatSerch = request.Data.InvertCategorySearch,
                PageIndex = request.PageIndex,
                PageSize = request.PageSize + 1
            };

            var data = await Task.Factory.StartNew(() => Client.UserService.getUserFriendsInCategory(serviceRequest, session.GetSession())).ConfigureAwait(false);
            var result = new PaginatedResponse<IEnumerable<FriendsInCategoryResponse>>
            {
                Page = data.Select(x => new FriendsInCategoryResponse
                {
                    UserId = x.UserId,
                    UserName = x.UserName,
                    Image = x.Picture,
                    FirstName = x.FirstName,
                    LastName = x.LastName,
                    Title = x.Title,
                    UserTypeId = (SystemUserType)x.UserTypeId,
                    Email = x.Email
                }).Take(request.PageSize),
                HasNextPage = data.Count > request.PageSize
            };

            return result;
        }
开发者ID:tektak-abhisheksth,项目名称:Web-API,代码行数:30,代码来源:CategoryRepositorySealed.cs

示例13: GetProfileViewDetail

        public async Task<PaginatedResponseExtended<IEnumerable<ViewerDetailResponse>, int>> GetProfileViewDetail(PaginatedRequest<GeneralKvPair<SystemProfileViewType, int>> request, SystemSession session)
        {
            var serviceRequest = new ProfileView
            {
                UserId = request.UserId,
                ViewType = (byte)request.Data.Id,
                TypeId = request.Data.Value,
                PageIndex = request.PageIndex,
                PageSize = request.PageSize
            };

            var response = await Task.Factory.StartNew(() => Client.UserService.profileViewDetail(serviceRequest, session.GetSession())).ConfigureAwait(false);
            var data = response.ProfileViews.Select(x => new ViewerDetailResponse
            {
                UserId = x.UserId,
                UserTypeId = (SystemUserType)x.UserTypeId,
                UserName = x.Username,
                FirstName = x.FirstName,
                LastName = x.LastName,
                Image = x.Picture,
                FriendshipStatus = (SystemFriendshipStatus)x.IsConnected,
                Observed = x.Observed,
                Title = x.Title,
                ViewedDate = Convert.ToDateTime(x.ViewDate)
            });
            var result = new PaginatedResponseExtended<IEnumerable<ViewerDetailResponse>, int>
            {
                Page = data,
                HasNextPage = response.HasNextPage,
                Information = response.ViewCount
            };
            return result;
        }
开发者ID:tektak-abhisheksth,项目名称:Web-API,代码行数:33,代码来源:ProfileRepositorySealed.cs

示例14: SyncPhoneBook

 public async Task<StatusData<string>> SyncPhoneBook(PhoneBookContactsRequest request, SystemSession session)
 {
     var contacts = new UserMobileContacts
     {
         CTag = request.CTag,
         DeviceId = request.DeviceId,
         UserId = request.UserId,
         ToAddmobileContacts =
             request.Add.Select(
                 x =>
                     new MobileContact
                     {
                         CountryCode = x.CountryCode,
                         PrimaryContactNumber = x.MobileNumber.ToString()
                     }).ToList(),
         ToDelmobileContacts =
             request.Delete.Select(
                 x =>
                     new MobileContact
                     {
                         CountryCode = x.CountryCode,
                         PrimaryContactNumber = x.MobileNumber.ToString()
                     }).ToList(),
         Flush = request.Flush
     };
     var result = new StatusData<string>();
     var response = (await Task.Factory.StartNew(() => Client.UserService.contactSync(contacts, session.GetSession())).ConfigureAwait(false));
     result.Status = (SystemDbStatus)response.SystemDbStatus;
     result.Data = response.CTag;
     result.Message = response.DbStatusMsg;
     return result;
 }
开发者ID:tektak-abhisheksth,项目名称:Web-API,代码行数:32,代码来源:FriendRepository.cs

示例15: Crop

        ////public async Task<StatusData<bool>> Crop(ImageCropRequest cropRequest, SystemSession session)
        ////{
        ////    var serviceRequest = new Elif { FileId = cropRequest.FileId, AskWebp = cropRequest.AskWebp, Username = cropRequest.UserName };
        ////    var serviceCropRequest = new ElifImageCrop { Width = cropRequest.CropDetail.Width, Height = cropRequest.CropDetail.Height, Top = cropRequest.CropDetail.Top, Bottom = cropRequest.CropDetail.Bottom, Left = cropRequest.CropDetail.Left, Right = cropRequest.CropDetail.Right, SizeCodes = (SizedCodes)cropRequest.CropDetail.SizeCode };
        ////    var response = await Task.Factory.StartNew(() => Client.ElifService.doCrop(serviceRequest, serviceCropRequest, session.GetSession())).ConfigureAwait(false);
        ////    var result = new StatusData<bool> { Status = response ? SystemDbStatus.Updated : SystemDbStatus.NotModified, Data = response };
        ////    return result;
        ////}

        public async Task<StatusData<bool>> Crop(ImageCropRequest cropRequest, SystemSession session)
        {
            var result = new StatusData<bool> { Status = SystemDbStatus.Updated };
            var serviceRequest = new Elif { FileId = cropRequest.FileId, AskWebp = cropRequest.AskWebp, Username = cropRequest.UserName };
            var serviceCropRequest = new ElifImageCrop { Width = cropRequest.CropDetail.Width, Height = cropRequest.CropDetail.Height, Top = cropRequest.CropDetail.Top, Bottom = cropRequest.CropDetail.Bottom, Left = cropRequest.CropDetail.Left, Right = cropRequest.CropDetail.Right, SizeCodes = (SizedCodes)cropRequest.CropDetail.SizeCode };
            result.Data = await Task.Factory.StartNew(() => Client.ElifService.doCrop(serviceRequest, serviceCropRequest, session.GetSession())).ConfigureAwait(false);
            return result;
        }
开发者ID:tektak-abhisheksth,项目名称:Web-API,代码行数:17,代码来源:MediaRepository.cs


注:本文中的Model.Types.SystemSession.GetSession方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。