Exemplo n.º 1
0
        public OperationResult Update(Topic topic)
        {
            var operationExecution = new OperationExecution();

            Action update = () =>
            {
                var topicService = new TopicService();
                topicService.Update(topic);
            };

            return(operationExecution.ExecuteOperation(update));
        }
Exemplo n.º 2
0
        public OperationResult Delete(Guid id)
        {
            var operationExecution = new OperationExecution();

            Action delete = () =>
            {
                var topicService = new TopicService();
                topicService.Delete(id);
            };

            return(operationExecution.ExecuteOperation(delete));
        }
Exemplo n.º 3
0
        public OperationResult <Topic> Get(Guid?id)
        {
            var operationExecution = new OperationExecution();

            Func <Topic> get = () =>
            {
                var topicService = new TopicService();
                return(topicService.GetTopic(id));
            };

            return(operationExecution.ExecuteOperation(get));
        }
Exemplo n.º 4
0
        public OperationResult <IQueryable <Topic> > Get()
        {
            var operationExecution = new OperationExecution();

            Func <IQueryable <Topic> > get = () =>
            {
                var topicService = new TopicService();
                return(topicService.GetTopics().AsQueryable());
            };

            return(operationExecution.ExecuteOperation(get));
        }
Exemplo n.º 5
0
        public OperationResult Update(User user)
        {
            var operationExecution = new OperationExecution();

            Action update = () =>
            {
                var userService = new UserService();
                userService.Update(user);
            };

            return(operationExecution.ExecuteOperation(update));
        }
Exemplo n.º 6
0
        public OperationResult <User> Get(string name)
        {
            var operationExecution = new OperationExecution();

            Func <User> get = () =>
            {
                var userService = new UserService();
                return(userService.GetUserByName(name));
            };

            return(operationExecution.ExecuteOperation(get));
        }
Exemplo n.º 7
0
        public OperationResult <User> Get(Guid id)
        {
            var operationExecution = new OperationExecution();

            Func <User> get = () =>
            {
                var userService = new UserService();
                return(userService.GetUser(id));
            };

            return(operationExecution.ExecuteOperation(get));
        }