本文整理汇总了C#中Season.SetIdTo方法的典型用法代码示例。如果您正苦于以下问题:C# Season.SetIdTo方法的具体用法?C# Season.SetIdTo怎么用?C# Season.SetIdTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Season
的用法示例。
在下文中一共展示了Season.SetIdTo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Given
public override void Given()
{
seasons = new List<Season>();
activeSeason = new Season(name, GameType.EightBall);
activeSeason.IsActive = true;
seasons.Add(activeSeason);
for (int i = 1; i <= inactiveCount; i++) {
var season = new Season("other" + i.ToString(), GameType.EightBall);
seasons.Add(season);
}
newActiveSeason = new Season("newactive", GameType.EightBall);
newActiveSeason.SetIdTo(newActiveSeasonId);
seasons.Add(newActiveSeason);
repository.Setup(r => r.All<Season>()).Returns(seasons.AsQueryable());
repository.Setup(r => r.SaveChanges()).Verifiable();
repository.Setup(r => r.Get<Season>(newActiveSeasonId)).Returns(newActiveSeason);
}
示例2: Given
public override void Given()
{
viewModel = new CreateDivisionViewModel();
viewModel.Name = "MyDivision";
viewModel.StartingDate = DateTime.Parse("11/30/2010").ToShortDateString();
viewModel.SeasonId = 1;
var season = new Season("temp", GameType.EightBall);
season.SetIdTo(viewModel.SeasonId);
repository.Setup(r => r.Get<Season>(season.Id)).Returns(season);
repository.Setup(r => r.All<Division>()).Returns(new List<Division>().AsQueryable());
repository.Setup(r => r.SaveOrUpdate<Division>(It.IsAny<Division>())).Callback<Division>(d => savedDivision = d).Returns(savedDivision);
}