本文整理汇总了C#中Model.Types.SystemSession类的典型用法代码示例。如果您正苦于以下问题:C# SystemSession类的具体用法?C# SystemSession怎么用?C# SystemSession使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SystemSession类属于Model.Types命名空间,在下文中一共展示了SystemSession类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetBasicUsersInformation
public virtual async Task<IEnumerable<BaseInfoResponse>> GetBasicUsersInformation(SingleData<List<string>> request, SystemSession session)
{
IEnumerable<BaseInfoResponse> response = null;
var result =
await
Task.Factory.StartNew(
() => Client.UserService.getUsersInfo(String.Join(",", request.Data), session.GetSession()))
.ConfigureAwait(false);
if (result.Any())
{
response = result.Select(x => new BaseInfoResponse
{
UserId = Convert.ToInt32(x.UserId),
UserName = x.UserName,
UserTypeId = (SystemUserType)x.UserTypeId,
Picture = x.Picture,
Title = x.Title,
Email = x.Email,
FirstName = x.FirstName,
LastName = x.LastName
});
}
return response;
}
示例2: 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;
}
示例3: 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;
}
示例4: 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;
}
示例5: 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;
}
示例6: GetProfileInformation
public async Task<PersonalProfileResponse> GetProfileInformation(string targetUser, SystemSession session)
{
var profileInfo = await _jUnitOfWork.Profile.GetProfileInformation(targetUser, session).ConfigureAwait(false);
var contactInfo = await _jUnitOfWork.Profile.GetContacts(targetUser, true, null, session).ConfigureAwait(false);
//var contactInfo = await _unitOfWork.Profile.GetContacts(userId, targetUser, null).ConfigureAwait(false);
//var profileInfo = await profileInfoTask;
//var contactInfo = await contactInfoTask;
//var employmentHistoryInfoTask = _unitOfWork.Profile.GetEmployment(userId, profileInfo.BasicInformation.UserId);
//var employmentHistoryInfo = await employmentHistoryInfoTask.ConfigureAwait(false);
var employmentHistoryInfo = await _jUnitOfWork.Profile.GetEmploymentHistory(targetUser, session).ConfigureAwait(false);
var contactInformations = contactInfo as TemporaryContactInformation[] ?? contactInfo.ToArray();
var home = contactInformations.FirstOrDefault(x => x.ContactTypeId == SystemContactType.Home);
var office = contactInformations.FirstOrDefault(x => x.ContactTypeId == SystemContactType.Office);
profileInfo.Contacts = new Contact
{
Home = home == null ? null : home.GetParent(),
Office = office == null ? null : office.GetParent(),
Temporary = contactInformations.Where(x => x.ContactTypeId != SystemContactType.Home && x.ContactTypeId != SystemContactType.Office)
};
profileInfo.EmploymentHistory = employmentHistoryInfo;
return profileInfo;
}
示例7: 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;
}
示例8: 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;
}
示例9: 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;
}
示例10: 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;
}
示例11: 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;
}
示例12: 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;
}
示例13: GetProfiles
public async Task<List<ProfileOfflineResponse>> GetProfiles(IEnumerable<GeneralKvPair<int, long>> profileTags, SystemSession session)
{
var response = new List<ProfileOfflineResponse>();
var basicInfo = await _unitOfWork.Profile.GetProfiles(session.UserId, profileTags).ConfigureAwait(false);
if (basicInfo.Any())
{
var contactInfoTask = _unitOfWork.Profile.GetProfilesContacts(session.UserId, basicInfo.Select(x => x.UserId)).ConfigureAwait(false);
response.AddRange(basicInfo.Select(x => new ProfileOfflineResponse { BasicInformation = x }));
var contactInfo = await contactInfoTask;
foreach (var profileOfflineResponse in response)
{
var home = contactInfo.Where(x => x.UserId == profileOfflineResponse.BasicInformation.UserId).FirstOrDefault(x => x.ContactTypeId == SystemContactType.Home);
var office = contactInfo.Where(x => x.UserId == profileOfflineResponse.BasicInformation.UserId).FirstOrDefault(x => x.ContactTypeId == SystemContactType.Office);
profileOfflineResponse.Contacts = new Contact
{
Home = home == null ? null : home.GetParent(),
Office = office == null ? null : office.GetParent(),
Temporary = contactInfo.Where(x => x.UserId == profileOfflineResponse.BasicInformation.UserId).Where(x => x.ContactTypeId != SystemContactType.Home && x.ContactTypeId != SystemContactType.Office)
};
}
}
return response;
}
示例14: 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;
}
示例15: 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;
}