private static async Task SetBO1_BO2_JAsync(MyBO bo, ISession s, TBO1_BO2_J value, Action <MyRef2, int?> set, CancellationToken cancellationToken = default(CancellationToken)) { switch (value) { case TBO1_BO2_J.Null: bo.BO1 = null; break; case TBO1_BO2_J.BO1: (await(bo.GetOrCreateBO1Async(s, cancellationToken))).BO2 = null; break; case TBO1_BO2_J.ValueNull: set(await((await(bo.GetOrCreateBO1Async(s, cancellationToken))).GetOrCreateBO2Async(s, cancellationToken)), null); break; case TBO1_BO2_J.Zero: set(await((await(bo.GetOrCreateBO1Async(s, cancellationToken))).GetOrCreateBO2Async(s, cancellationToken)), 0); break; case TBO1_BO2_J.One: set(await((await(bo.GetOrCreateBO1Async(s, cancellationToken))).GetOrCreateBO2Async(s, cancellationToken)), 1); break; default: throw new Exception("Value " + value + " not handled in code"); } }
private static void SetBO1_BO2_J(MyBO bo, ISession s, TBO1_BO2_J value, Action <MyRef2, int?> set) { switch (value) { case TBO1_BO2_J.Null: bo.BO1 = null; break; case TBO1_BO2_J.BO1: bo.GetOrCreateBO1(s).BO2 = null; break; case TBO1_BO2_J.ValueNull: set(bo.GetOrCreateBO1(s).GetOrCreateBO2(s), null); break; case TBO1_BO2_J.Zero: set(bo.GetOrCreateBO1(s).GetOrCreateBO2(s), 0); break; case TBO1_BO2_J.One: set(bo.GetOrCreateBO1(s).GetOrCreateBO2(s), 1); break; default: throw new Exception("Value " + value + " not handled in code"); } }
public static void Set_BO1_BO2_J2(MyBO bo, ISession s, TBO1_BO2_J value) { SetBO1_BO2_J(bo, s, value, (b, i) => b.J2 = i ?? 0); }
public static void SetBO1_BO2_J1(MyBO bo, ISession s, TBO1_BO2_J value) { SetBO1_BO2_J(bo, s, value, (b, i) => b.J1 = i); }
private static void SetBO1_BO2_J(MyBO bo, ISession s, TBO1_BO2_J value, Action<MyRef2, int?> set) { switch (value) { case TBO1_BO2_J.Null: bo.BO1 = null; break; case TBO1_BO2_J.BO1: bo.GetOrCreateBO1(s).BO2 = null; break; case TBO1_BO2_J.ValueNull: set(bo.GetOrCreateBO1(s).GetOrCreateBO2(s), null); break; case TBO1_BO2_J.Zero: set(bo.GetOrCreateBO1(s).GetOrCreateBO2(s), 0); break; case TBO1_BO2_J.One: set(bo.GetOrCreateBO1(s).GetOrCreateBO2(s), 1); break; default: throw new Exception("Value " + value + " not handled in code"); } }
public static Task Set_BO1_BO2_J2Async(MyBO bo, ISession s, TBO1_BO2_J value, CancellationToken cancellationToken = default(CancellationToken)) { return(SetBO1_BO2_JAsync(bo, s, value, (b, i) => b.J2 = i ?? 0, cancellationToken)); }