本文整理汇总了C#中IContext.Insert方法的典型用法代码示例。如果您正苦于以下问题:C# IContext.Insert方法的具体用法?C# IContext.Insert怎么用?C# IContext.Insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IContext
的用法示例。
在下文中一共展示了IContext.Insert方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AssignSeat
private void AssignSeat(IContext ctx, Context context, Guest guest, Count count)
{
var cnt = count.Value;
var seating = new Seating(cnt, 0, true, 1, guest.Name, 1, guest.Name);
ctx.Insert(seating);
var path = new Path(cnt, 1, guest.Name);
ctx.Insert(path);
count.Increment();
ctx.Update(count);
context.SetState(ContextState.AssignSeats);
ctx.Update(context);
}
示例2: AssignSeat
private void AssignSeat(IContext ctx, Context context, Seating seating, Guest guest1, Guest guest2, Count count)
{
int rightSeat = seating.RightSeatId;
int seatId = seating.Id;
int cnt = count.Value;
var newSeating = new Seating(cnt, seatId, false, rightSeat, seating.RightGuestName, rightSeat + 1, guest2.Name);
ctx.Insert(newSeating);
var path = new Path(cnt, rightSeat + 1, guest2.Name);
ctx.Insert(path);
var chosen = new Chosen(seatId, guest2.Name, guest1.Hobby);
ctx.Insert(chosen);
count.Increment();
ctx.Update(count);
context.SetState(ContextState.MakePath);
ctx.Update(context);
}
示例3: MakeNewPath
private void MakeNewPath(IContext ctx, Context context, Seating seating, Path path)
{
var newPath = new Path(seating.Id, path.SeatId, path.GuestName);
ctx.Insert(newPath);
}
示例4: InsertAlert
private static void InsertAlert(IContext context, int severity, Claim claim, string message)
{
var alert = new ClaimAlert { Severity = severity, Claim = claim, RuleName = context.Rule.Name, Message = message };
context.Insert(alert);
}