public void updates_EventTopic()
        {
            //setup
            var request = new UpdateEventTopicRequest();
            request.Id = _existingEventTopicId;
            request.IsEnabled = false;
            request.Name = _updatedEventName;

            var handler = CreateHandler();

            //act
            var response = HandleRequest<UpdateEventTopicResponse>(handler, request);

            //assert
            using (var context = _objectContextFactory.CreateObjectContext())
            {
                context.ContextOptions.LazyLoadingEnabled = true;
                context.ContextOptions.ProxyCreationEnabled = true;
                var Event = context.CreateObjectSet<EventTopic>().Single(e => e.Id == _existingEventTopicId);

                Assert.AreEqual(request.Id, _existingEventTopicId);
                Assert.AreEqual(request.IsEnabled, false);
                Assert.AreEqual(request.Name, _updatedEventName);
            }
        }
        private void Save()
        {
            _eventTopicId = int.Parse(CommonUtils.GetFieldValue(_viewModel.Fields, _id), CultureInfo.InvariantCulture);

            var nameValue = CommonUtils.GetFieldValue(_viewModel.Fields, _name);
            var isEnabledValue = bool.Parse(CommonUtils.GetFieldValue(_viewModel.Fields, _isEnabled));

            if (string.IsNullOrEmpty(nameValue))
                throw new Exception("Event Topic name is required.");

            if (_eventTopicId == 0)
            {
                var request = new AddEventTopicRequest
                {
                    Name = nameValue,
                    IsEnabled = isEnabledValue
                };

                _eventTopicId = ProcessRequest<AddEventTopicResponse>(request).Id;
            }
            else
            {
                if (_viewModel.Action == RecordActions.Edited)
                {
                    var updateRequest = new UpdateEventTopicRequest
                    {
                        Id = _eventTopicId,
                        Name = nameValue,
                        IsEnabled = isEnabledValue
                    };

                    ProcessRequest<UpdateEventTopicResponse>(updateRequest);
                }
            }
        }