本文整理汇总了C#中Schedule.ToSerializable方法的典型用法代码示例。如果您正苦于以下问题:C# Schedule.ToSerializable方法的具体用法?C# Schedule.ToSerializable怎么用?C# Schedule.ToSerializable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Schedule
的用法示例。
在下文中一共展示了Schedule.ToSerializable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetUpcomingPrograms
/// <summary>
/// Get all upcoming programs for the given schedule.
/// </summary>
/// <param name="schedule">The schedule.</param>
/// <param name="includeCancelled">Set to true to also retrieve cancelled programs.</param>
/// <returns>A list with zero or more upcoming programs.</returns>
public async Task<List<UpcomingProgram>> GetUpcomingPrograms(Schedule schedule, bool includeCancelled)
{
var request = NewRequest(HttpMethod.Post, "UpcomingProgramsForSchedule");
request.AddBody(new
{
Schedule = schedule.ToSerializable(),
IncludeCancelled = includeCancelled
});
return await ExecuteAsync<List<UpcomingProgram>>(request).ConfigureAwait(false);
}
示例2: SaveSchedule
/// <summary>
/// Save a new or modified schedule. A new schedule is recognized by a Guid.Empty ID.
/// </summary>
/// <param name="schedule">The schedule to save.</param>
/// <returns>The saved schedule.</returns>
public async Task<Schedule> SaveSchedule(Schedule schedule)
{
var request = NewRequest(HttpMethod.Post, "SaveSchedule");
request.AddBody(schedule.ToSerializable());
var result = await ExecuteAsync<SerializableSchedule>(request).ConfigureAwait(false);
return result.ToSchedule();
}