Example #1
0
        public Participant Query(ParticipantIdentityPredicate identity)
        {
            using (var cn = _connectionFactory.CreateConnection())
            {
                Participant participant = _predicateFactory.Create(identity);

                return(cn.Get(participant));
            }
        }
Example #2
0
        public ActionResult Delete([FromRoute][FromQuery] ParticipantIdentityPredicate predicate)
        {
            var request = new DeleteRequest <ParticipantIdentityPredicate>()
            {
                Identity = predicate,
            };

            var response = _app.Delete(request);

            return(new ApplicationResult <Participant>(response));
        }
Example #3
0
        public ActionResult Get([FromRoute][FromQuery] ParticipantIdentityPredicate predicate)
        {
            var request = new QueryIdentityRequest <ParticipantIdentityPredicate>()
            {
                Predicate = predicate
            };

            var response = _app.Query(request);

            return(new ApplicationResult <Participant>(response));
        }
Example #4
0
        public Participant Delete(ParticipantIdentityPredicate predicate)
        {
            bool        sucess      = false;
            Participant Participant = _predicateFactory.Create(predicate);

            using (var cn = _connectionFactory.CreateConnection())
            {
                sucess = cn.Delete(Participant);
            }

            return(sucess ? Participant : null);
        }
Example #5
0
        public ActionResult Put([FromRoute][FromQuery] ParticipantIdentityPredicate predicate, [FromBody] ParticipantMessage message)
        {
            var request = new UpdateRequest <ParticipantIdentityPredicate, ParticipantMessage>()
            {
                Identity = predicate,
                Message  = message
            };

            var response = _app.Update(request);

            return(new ApplicationResult <Participant>(response));
        }
        public Participant Create(ParticipantIdentityPredicate predicate)
        {
            Participant Participant = new Participant();

            if (predicate.IdentityMode == BarbecueManager.Patterns.Application.Messages.IdentityMode.Identity)
            {
                if (int.TryParse(predicate.ParticipantIdentity, out int n))
                {
                    Participant.ParticipantID = n;
                }
            }
            else
            {
                Participant.Name = predicate.ParticipantIdentity;
            }

            return(Participant);
        }