protected override void Context()
 {
     base.Context();
     _eventExport                    = new EventExport();
     _eventExport.EntityId           = "Bla";
     _eventExport.ConditionFormulaId = 1;
     _assigmentExport                = new AssigmentExport();
     _assigmentExport.NewFormulaId   = 2;
     _assigmentExport.ObjectId       = 3;
     _assigmentExport.UseAsValue     = true;
     _eventExport.AssignmentList.Add(_assigmentExport);
     _eventExport.Id = 4;
 }
Пример #2
0
        /// <summary>
        ///    Visit the specified object.
        /// </summary>
        /// <param name="eventToVisit">The object to visit.</param>
        public void Visit(IEvent eventToVisit)
        {
            var eventExport = new EventExport
            {
                Id                 = idFor(eventToVisit),
                EntityId           = eventToVisit.Id,
                ConditionFormulaId = mapFormula(eventToVisit, eventToVisit.Formula).Id,
                OneTime            = eventToVisit.OneTime
            };

            foreach (var assignment in eventToVisit.Assignments)
            {
                var alternateFormula = assignment.Formula;
                var assigmentExport  = new AssigmentExport
                {
                    ObjectId     = idFor(assignment.ChangedEntity),
                    NewFormulaId = mapFormula(assignment, alternateFormula).Id,
                    UseAsValue   = assignment.UseAsValue
                };
                eventExport.AssignmentList.Add(assigmentExport);
            }

            _modelExport.EventList.Add(eventExport);
        }