public UpdateProtocolGroupResponse UpdateProtocolGroup(UpdateProtocolGroupRequest request)
        {
            var group = this.PersistenceContext.Load <ProtocolGroup>(request.ProtocolGroupRef);

            var assembler = new ProtocolGroupAssembler();

            assembler.UpdateProtocolGroup(group, request.Detail, this.PersistenceContext);

            this.PersistenceContext.SynchState();

            return(new UpdateProtocolGroupResponse(assembler.GetProtocolGroupSummary(group)));
        }
        public AddProtocolGroupResponse AddProtocolGroup(AddProtocolGroupRequest request)
        {
            var assembler = new ProtocolGroupAssembler();

            var group = new ProtocolGroup();

            assembler.UpdateProtocolGroup(group, request.Detail, this.PersistenceContext);

            this.PersistenceContext.Lock(group, DirtyState.New);
            this.PersistenceContext.SynchState();

            return(new AddProtocolGroupResponse(assembler.GetProtocolGroupSummary(group)));
        }