public virtual void MergeSequence(Net.Vpc.Upa.Config.Decoration formulaInfo) { Net.Vpc.Upa.SequenceType stype = formulaInfo.GetEnum <Net.Vpc.Upa.SequenceType>("type", typeof(Net.Vpc.Upa.SequenceType)); Net.Vpc.Upa.FormulaType[] types = null; switch (stype) { case Net.Vpc.Upa.SequenceType.DEFAULT: case Net.Vpc.Upa.SequenceType.PERSIST: { types = new Net.Vpc.Upa.FormulaType[] { Net.Vpc.Upa.FormulaType.PERSIST }; break; } case Net.Vpc.Upa.SequenceType.UPDATE: { types = new Net.Vpc.Upa.FormulaType[] { Net.Vpc.Upa.FormulaType.UPDATE }; break; } case Net.Vpc.Upa.SequenceType.BOTH: { types = new Net.Vpc.Upa.FormulaType[] { Net.Vpc.Upa.FormulaType.PERSIST, Net.Vpc.Upa.FormulaType.UPDATE }; break; } } if (types.Length == 0) { types = new Net.Vpc.Upa.FormulaType[] { Net.Vpc.Upa.FormulaType.PERSIST, Net.Vpc.Upa.FormulaType.UPDATE }; } foreach (Net.Vpc.Upa.FormulaType type in types) { object o = Net.Vpc.Upa.Impl.FwkConvertUtils.GetMapValue <Net.Vpc.Upa.FormulaType, object>(all, type); Net.Vpc.Upa.Impl.Config.Annotationparser.SequenceInfo old = (o is Net.Vpc.Upa.Impl.Config.Annotationparser.SequenceInfo) ? (Net.Vpc.Upa.Impl.Config.Annotationparser.SequenceInfo)o : null; if (old == null) { old = new Net.Vpc.Upa.Impl.Config.Annotationparser.SequenceInfo(repo); old.configOrder = System.Int32.MinValue; all[type] = old; } old.MergeSequence(formulaInfo); } }
public virtual void MergeFormula(Net.Vpc.Upa.Config.Decoration formulaInfo) { Net.Vpc.Upa.FormulaType[] types = formulaInfo.GetPrimitiveArray <Net.Vpc.Upa.FormulaType>("type", typeof(Net.Vpc.Upa.FormulaType)); if (types.Length == 0) { types = new Net.Vpc.Upa.FormulaType[] { Net.Vpc.Upa.FormulaType.PERSIST, Net.Vpc.Upa.FormulaType.UPDATE }; } foreach (Net.Vpc.Upa.FormulaType type in types) { object o = Net.Vpc.Upa.Impl.FwkConvertUtils.GetMapValue <Net.Vpc.Upa.FormulaType, object>(all, type); Net.Vpc.Upa.Impl.Config.Annotationparser.FormulaInfo old = (o is Net.Vpc.Upa.Impl.Config.Annotationparser.FormulaInfo) ? (Net.Vpc.Upa.Impl.Config.Annotationparser.FormulaInfo)o : null; if (old == null) { old = new Net.Vpc.Upa.Impl.Config.Annotationparser.FormulaInfo(); old.configOrder = System.Int32.MinValue; old.formulaType = type; all[type] = old; } old.MergeFormula(formulaInfo); } }