本文整理汇总了C#中ListResult类的典型用法代码示例。如果您正苦于以下问题:C# ListResult类的具体用法?C# ListResult怎么用?C# ListResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ListResult类属于命名空间,在下文中一共展示了ListResult类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: RetrievePortManningTest
public async Task RetrievePortManningTest()
{
var portManningResult = new ListResult<PortManning>();
this.portManningData.Setup(mockItem => mockItem.RetrievePortManning(It.IsAny<PortManningSearchParameters>())).Returns(Task.FromResult(portManningResult));
var portMainingDetails = await this.portManningManager.RetrievePortManning(new PortManningSearchParameters());
Assert.AreSame(portManningResult, portMainingDetails);
}
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:7,代码来源:PortManningManagerTests.cs
示例2: AssignAlertSearchResult
/// <summary>
/// Assigns the alert search result.
/// </summary>
/// <param name="alertItemList">The alert item list.</param>
public void AssignAlertSearchResult(ListResult<Alert> alertItemList)
{
if (alertItemList != null)
{
this.alertItemListResult = alertItemList;
}
}
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:11,代码来源:PassengerDetailsPresenter.cs
示例3: ListAsync
/// <summary>
/// gets the list of gangway history search parameters
/// </summary>
/// <param name="searchParameters"> searchParameters identifier</param>
/// <returns> returns list of gangway history parameters </returns>
public async Task<ListResult<GangwayHistory>> ListAsync(GangwayHistorySearchParameters searchParameters)
{
var list = new ListResult<GangwayHistory>();
var gangwayHistoryList = await this.personEventClientRepository.RetrieveEventListAsync(new PersonHistorySearchParameters { MachineName = searchParameters.MachineName, EventTypeIds = searchParameters.EventTypeIds, ShipId = searchParameters.ShipId, VoyageIds = searchParameters.VoyageIds, PageNumber = searchParameters.PageNumber, PersonTypeId = searchParameters.PersonTypeId, MaxResults = searchParameters.MaxResults, PersonIds = searchParameters.PersonId });
var personTypeList = await DIContainer.Instance.Resolve<IReferenceDataRepository>().RetrievePersonTypeListAsync();
var guestTypePerson = personTypeList.Items.FirstOrDefault(personType => personType.Name.Equals(GuestType, StringComparison.OrdinalIgnoreCase));
var crewTypePerson = personTypeList.Items.FirstOrDefault(personType => personType.Name.Equals(CrewType, StringComparison.OrdinalIgnoreCase));
var visitorTypePerson = personTypeList.Items.FirstOrDefault(personType => personType.Name.Equals(VisitorType, StringComparison.OrdinalIgnoreCase));
var guestIds = guestTypePerson != null ? gangwayHistoryList.Items.DistinctBy(b => b.PersonId).Where(a => a.PersonTypeId.Equals(guestTypePerson.PersonTypeId)).ToList().RetrieveIds(a => a.PersonId) : null;
var crewMemberIds = crewTypePerson != null ? gangwayHistoryList.Items.DistinctBy(b => b.PersonId).Where(a => a.PersonTypeId.Equals(crewTypePerson.PersonTypeId)).ToList().RetrieveIds(a => a.PersonId) : null;
var visitorIds = visitorTypePerson != null ? gangwayHistoryList.Items.DistinctBy(b => b.PersonId).Where(a => a.PersonTypeId.Equals(visitorTypePerson.PersonTypeId)).ToList().RetrieveIds(a => a.PersonId) : null;
var guests = !string.IsNullOrEmpty(guestIds) ? await this.personRepository.RetrieveGuest(null, guestIds, null, null, null, null, null, null, null, null, null, null, null, null, searchParameters.MaxResults, GuestParts) : null;
var crews = !string.IsNullOrEmpty(crewMemberIds) ? GangwayHistoryMapper.MapCrew(await this.personRepository.RetrieveCrew(null, crewMemberIds, null, null, null, null, null, null, null, searchParameters.MaxResults, CrewParts)) : null;
var visitors = !string.IsNullOrEmpty(visitorIds) ? await this.personRepository.RetrieveVisitor(null, visitorIds, null, null, null, null, null, null, searchParameters.MaxResults, VisitorParts) : null;
foreach (var item in gangwayHistoryList.Items)
{
MapPersonInformation(personTypeList, guests, crews, visitors, item);
list.Items.Add(item);
}
list.TotalResults = gangwayHistoryList.TotalResults;
return list;
}
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:34,代码来源:GangwayHistoryRepository.cs
示例4: AutocompleteExporterGetTotal
public void AutocompleteExporterGetTotal()
{
// Arrange
var storeMock = new Mock<IStore<AutocompleteEntity>>();
var listResult = new ListResult<AutocompleteEntity>();
listResult.Status = "ok";
listResult.Total = 2;
listResult.Hits = new List<AutocompleteEntity>
{
new AutocompleteEntity {Id = "testId1"},
new AutocompleteEntity {Id = "testId2"}
};
storeMock.Setup(s => s.List(Helpers.AllSitesId, Helpers.AllLanguages, 0, It.IsAny<int>())).Returns(listResult);
var storeFactoryMock = new Mock<IStoreFactory>();
storeFactoryMock.Setup(f => f.GetStore<AutocompleteEntity>()).Returns(storeMock.Object);
var exporter = new AutocompleteExporter(storeFactoryMock.Object);
// Act
var count = exporter.GetTotalCount(Helpers.AllSitesId, Helpers.AllLanguages);
// Assert
Assert.Equal(2, count);
}
开发者ID:SergVro,项目名称:FindExportImport,代码行数:25,代码来源:ExporterTests.cs
示例5: AutocompleteExporterDeleteAll
public void AutocompleteExporterDeleteAll()
{
// Arrange
var storeMock = new Mock<IStore<AutocompleteEntity>>();
var listResult = new ListResult<AutocompleteEntity>();
listResult.Status = "ok";
listResult.Total = 2;
listResult.Hits = new List<AutocompleteEntity>
{
new AutocompleteEntity {Id = "testId1"},
new AutocompleteEntity {Id = "testId2"}
};
storeMock.Setup(s => s.List(Helpers.AllSitesId, Helpers.AllLanguages, 0, It.IsAny<int>())).Returns(listResult);
var storeFactoryMock = new Mock<IStoreFactory>();
storeFactoryMock.Setup(f => f.GetStore<AutocompleteEntity>()).Returns(storeMock.Object);
var exporter = new AutocompleteExporter(storeFactoryMock.Object);
// Act
exporter.DeleteAll(Helpers.AllSitesId, Helpers.AllLanguages);
// Assert
storeMock.Verify(s => s.Delete(It.IsAny<string>()), Times.Exactly(2));
}
开发者ID:SergVro,项目名称:FindExportImport,代码行数:25,代码来源:ExporterTests.cs
示例6: Map
/// <summary>
/// Maps the alert.
/// </summary>
/// <param name="alerts">The alerts.</param>
/// <param name="personAlert">The person alert.</param>
/// <param name="alertTypeList">The alert Type Master List.</param>
/// <returns>
/// Return instance of alert.
/// </returns>
private static Alert Map(IEnumerable<DataAccess.Entities.Alert> alerts, DataAccess.Entities.PersonAlert personAlert, ListResult<DataAccess.Entities.AlertType> alertTypeList)
{
var alert = alerts.FirstOrDefault(a => a.AlertId.Equals(personAlert.AlertId, StringComparison.OrdinalIgnoreCase));
var alertType = alert != null ? alertTypeList.Items.FirstOrDefault(a => a.AlertTypeId.Equals(alert.AlertTypeId, StringComparison.OrdinalIgnoreCase)) : null;
if (alertType != null)
{
return new Alert
{
AlertId = personAlert.PersonAlertId,
AddedDateTime = alert.AddedDate,
AddedBy = alert.AddedBy,
Message = new Message
{
Subject = alert.Code,
Description = alert.Description,
},
StatusUpdatedBy = personAlert.StatusUpdatedBy,
StatusUpdatedDate = personAlert.StatusUpdatedDate,
AlertType = alertType.Name,
IsDenyAshore = alertType.AlertTypeId.Equals(IsDenyAshoreId, StringComparison.OrdinalIgnoreCase) || alertType.AlertTypeId.Equals(IsDenyBothId, StringComparison.OrdinalIgnoreCase) || alertType.AlertTypeId.Equals(IsCBPClearanceId, StringComparison.OrdinalIgnoreCase),
IsDenyOnboard = alertType.AlertTypeId.Equals(IsDenyOnboardId, StringComparison.OrdinalIgnoreCase) || alertType.AlertTypeId.Equals(IsDenyBothId, StringComparison.OrdinalIgnoreCase),
IsOverride = alert.IsOverride,
IsSoundEnable = alert.IsSoundEnable
};
}
return null;
}
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:38,代码来源:AlertMapper.cs
示例7: ImportPortManningTest
public async Task ImportPortManningTest()
{
var portManningResult = new ListResult<PortManning>();
this.portManningData.Setup(mockItem => mockItem.ImportPortManning(It.IsNotNull<ImportPortManning>())).Returns(Task.FromResult(portManningResult));
var portMainingDetails = await this.portManningManager.ImportPortManning(new ImportPortManning());
Assert.AreSame(portManningResult, portMainingDetails);
}
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:7,代码来源:PortManningManagerTests.cs
示例8: ShipControllerTest
/// <summary>
/// Initializes a new instance of the <see cref="ShipControllerTest"/> class.
/// </summary>
public ShipControllerTest()
{
this.shipManager = new Mock<IShipManager>();
this.shipCollection = new ListResult<Ship>();
this.controller = new ShipController(this.shipManager.Object);
this.controller.Request = new HttpRequestMessage();
this.controller.Configuration = new HttpConfiguration();
}
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:11,代码来源:ShipControllerTest.cs
示例9: MapGuests
/// <summary>
/// Maps the guests.
/// </summary>
/// <param name="guest">The guest.</param>
/// <param name="personMessages">The messages.</param>
/// <param name="messageTypeList">The message Type Master List.</param>
internal static void MapGuests(Guest guest, ListResult<DataAccess.Entities.PersonMessage> personMessages, ListResult<DataAccess.Entities.MessageType> messageTypeList)
{
var messageCollection = MessageMapper.MapCollection(personMessages.Items, guest.GuestId, messageTypeList);
if (messageCollection != null && messageCollection.Count > 0)
{
guest.HasMessage = true;
guest.AssignMessages(messageCollection);
}
}
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:15,代码来源:PersonMessagesMapper.cs
示例10: MapVisitors
/// <summary>
/// Maps the visitors.
/// </summary>
/// <param name="visitor">The visitor.</param>
/// <param name="alerts">The alerts.</param>
/// <param name="personAlerts">The person alerts.</param>
/// <param name="alertTypeList">The alert Type Master List.</param>
internal static void MapVisitors(Visitor visitor, ListResult<DataAccess.Entities.Alert> alerts, ListResult<DataAccess.Entities.PersonAlert> personAlerts, ListResult<DataAccess.Entities.AlertType> alertTypeList)
{
var alertCollection = AlertMapper.MapCollection(alerts.Items, personAlerts.Items, visitor.VisitorId, alertTypeList);
if (alertCollection != null && alertCollection.Count > 0)
{
visitor.HasAlert = true;
visitor.AssignAlerts(alertCollection);
}
}
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:16,代码来源:PersonAlertMapper.cs
示例11: MapCrews
/// <summary>
/// Maps the crews.
/// </summary>
/// <param name="crewmember">The crew member.</param>
/// <param name="alerts">The alerts.</param>
/// <param name="personAlerts">The person alerts.</param>
/// <param name="alertTypeList">The alert Type Master List.</param>
internal static void MapCrews(Crewmember crewmember, ListResult<DataAccess.Entities.Alert> alerts, ListResult<DataAccess.Entities.PersonAlert> personAlerts, ListResult<DataAccess.Entities.AlertType> alertTypeList)
{
var alertCollection = AlertMapper.MapCollection(alerts.Items, personAlerts.Items, crewmember.CrewmemberId, alertTypeList);
if (alertCollection != null && alertCollection.Count > 0)
{
crewmember.HasAlert = true;
crewmember.AssignAlerts(alertCollection);
}
}
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:16,代码来源:PersonAlertMapper.cs
示例12: MapGuests
/// <summary>
/// Maps the guests.
/// </summary>
/// <param name="guest">The guest.</param>
/// <param name="alerts">The alerts.</param>
/// <param name="personAlerts">The person alerts.</param>
/// <param name="alertTypeList">The alert Type Master List.</param>
internal static void MapGuests(Guest guest, ListResult<DataAccess.Entities.Alert> alerts, ListResult<DataAccess.Entities.PersonAlert> personAlerts, ListResult<DataAccess.Entities.AlertType> alertTypeList)
{
var alertCollection = AlertMapper.MapCollection(alerts.Items, personAlerts.Items, guest.GuestId, alertTypeList);
if (alertCollection != null && alertCollection.Count > 0)
{
guest.HasAlert = true;
guest.AssignAlerts(alertCollection);
}
}
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:16,代码来源:PersonAlertMapper.cs
示例13: MapCrews
/// <summary>
/// Maps the crews.
/// </summary>
/// <param name="crewmember">The crew member.</param>
/// <param name="personMessages">The messages.</param>
/// <param name="messageTypeList">The message Type Master List.</param>
internal static void MapCrews(Crewmember crewmember, ListResult<DataAccess.Entities.PersonMessage> personMessages, ListResult<DataAccess.Entities.MessageType> messageTypeList)
{
var messageCollection = MessageMapper.MapCollection(personMessages.Items, crewmember.CrewmemberId, messageTypeList);
if (messageCollection != null && messageCollection.Count > 0)
{
crewmember.HasMessage = true;
crewmember.AssignMessages(messageCollection);
}
}
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:15,代码来源:PersonMessagesMapper.cs
示例14: MapVisitors
/// <summary>
/// Maps the visitors.
/// </summary>
/// <param name="visitor">The visitor.</param>
/// <param name="personMessages">The messages.</param>
/// <param name="messageTypeList">The message Type Master List.</param>
internal static void MapVisitors(Visitor visitor, ListResult<DataAccess.Entities.PersonMessage> personMessages, ListResult<DataAccess.Entities.MessageType> messageTypeList)
{
var messageCollection = MessageMapper.MapCollection(personMessages.Items, visitor.VisitorId, messageTypeList);
if (messageCollection != null && messageCollection.Count > 0)
{
visitor.HasMessage = true;
visitor.AssignMessages(messageCollection);
}
}
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:15,代码来源:PersonMessagesMapper.cs
示例15: MapListAsync
/// <summary>
/// Maps the list asynchronous.
/// </summary>
/// <param name="brandList">The brand list.</param>
/// <returns>List of Brand.</returns>
internal static ListResult<Brand> MapListAsync(ListResult<Entities.Brand> brandList)
{
var brandCollection = new ListResult<Brand>();
foreach (var ship in brandList.Items)
{
brandCollection.Items.Add(MapAsync(ship));
}
return brandCollection;
}
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:15,代码来源:BrandMapper.cs
示例16: MapListAsync
/// <summary>
/// Maps the list asynchronous.
/// </summary>
/// <param name="voyageList">The brand list.</param>
/// <returns>List of Brand.</returns>
internal static ListResult<Voyage> MapListAsync(ListResult<Entities.Voyage> voyageList)
{
var voyageCollection = new ListResult<Voyage>();
foreach (var voyage in voyageList.Items)
{
voyageCollection.Items.Add(MapAsync(voyage));
}
return voyageCollection;
}
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:15,代码来源:VoyageMapper.cs
示例17: MapListAsync
/// <summary>
/// Maps the list asynchronous.
/// </summary>
/// <param name="personEventList">The gangway history list.</param>
/// <returns>
/// List result of GangwayHistory
/// </returns>
internal static ListResult<GangwayHistory> MapListAsync(ListResult<PersonEvent> personEventList)
{
var gangwayHistoryCollection = new ListResult<GangwayHistory>();
foreach (var gangwayHistory in personEventList.Items)
{
gangwayHistoryCollection.Items.Add(MapAsync(gangwayHistory));
}
gangwayHistoryCollection.TotalResults = personEventList.TotalResults;
return gangwayHistoryCollection;
}
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:18,代码来源:GangwayHistoryMapper.cs
示例18: MapListAsync
/// <summary>
/// Maps the list asynchronous.
/// </summary>
/// <param name="crewmembers">The crewmember.</param>
/// <param name="staterooms">The staterooms.</param>
/// <param name="shipDateTime">The ship date time.</param>
/// <param name="safetyRoleList">The safety role list.</param>
/// <returns>crew member collection</returns>
internal static ICollection<Crewmember> MapListAsync(ListResult<DataAccess.Entities.Crewmember> crewmembers, ICollection<DataAccess.Entities.Stateroom> staterooms, DateTime? shipDateTime, ICollection<DataAccess.Entities.SafetyRole> safetyRoleList)
{
var collection = new Collection<Crewmember>();
foreach (var crew in crewmembers.Items)
{
MapCrew(staterooms, shipDateTime, safetyRoleList, collection, crew);
}
return collection;
}
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:19,代码来源:CrewmemberMapper.cs
示例19: MapListAsync
/// <summary>
/// Maps the list asynchronous.
/// </summary>
/// <param name="shipList">The ship list.</param>
/// <returns>Return list result of ship.</returns>
internal static ListResult<Ship> MapListAsync(ListResult<Entities.Ship> shipList)
{
var shipCollection = new ListResult<Ship>();
foreach (var ship in shipList.Items)
{
shipCollection.Items.Add(MapAsync(ship));
}
shipCollection.TotalResults = shipList.TotalResults;
return shipCollection;
}
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:17,代码来源:ShipMapper.cs
示例20: MapListAsync
/// <summary>
/// Maps the list asynchronous.
/// </summary>
/// <param name="stateroomCategoryList">The stateroom category list.</param>
/// <param name="stateroomCategoryTypeList">The stateroom category type list.</param>
/// <returns>
/// List of stateroom category.
/// </returns>
internal static ListResult<StateroomCategory> MapListAsync(ListResult<Entities.StateroomCategory> stateroomCategoryList, ListResult<Entities.StateroomCategoryType> stateroomCategoryTypeList)
{
var stateroomCategoryCollection = new ListResult<StateroomCategory>();
foreach (var stateroomCategory in stateroomCategoryList.Items)
{
var stateroomCategoryType = stateroomCategoryTypeList.Items.FirstOrDefault(a => a.StateroomCategoryTypeId.Equals(stateroomCategory.StateroomCategoryTypeId, StringComparison.OrdinalIgnoreCase));
stateroomCategoryCollection.Items.Add(MapAsync(stateroomCategory, stateroomCategoryType));
}
return stateroomCategoryCollection;
}
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:20,代码来源:StateroomCategoryMapper.cs
注:本文中的ListResult类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论