本文整理汇总了C#中IDocumentSession.GetRoomsByOwner方法的典型用法代码示例。如果您正苦于以下问题:C# IDocumentSession.GetRoomsByOwner方法的具体用法?C# IDocumentSession.GetRoomsByOwner怎么用?C# IDocumentSession.GetRoomsByOwner使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDocumentSession
的用法示例。
在下文中一共展示了IDocumentSession.GetRoomsByOwner方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetHome
static object GetHome(NancyContext context, IDocumentSession documentSession)
{
if (context == null) throw new ArgumentNullException("context");
var alert = context.GetAlert();
if (context.IsSignedUp())
{
var currentMember = context.GetCurrentMember(documentSession);
var gmRooms = documentSession.GetRoomsByOwner(currentMember.Id);
var playerRooms = documentSession.GetRoomsByPlayer(currentMember.Id);
return new DashboardResponse(gmRooms, playerRooms, alert);
}
return new MarketingPageResponse(alert);
}
示例2: GetMember
static object GetMember(
NancyContext context,
IDocumentSession documentSession,
string alias)
{
if (context == null) throw new ArgumentNullException("context");
if (documentSession == null) throw new ArgumentNullException("documentSession");
if (String.IsNullOrEmpty(alias))
return 404;
if (!context.IsSignedUp())
return 403;
var member = documentSession.GetMemberByAlias(alias);
if (member == null)
return 404;
var currentMember = context.GetCurrentMember(documentSession);
Debug.Assert(currentMember != null, "`requireSignedUp()` should ensure the current member is not null.");
if (!member.Alias.Equals(currentMember.Alias, StringComparison.OrdinalIgnoreCase))
return 403;
var rooms = documentSession.GetRoomsByOwner(member.Id);
return new MemberResponse(member, rooms);
}