Пример #1
0
        public OperationResult Update(Topic topic)
        {
            var operationExecution = new OperationExecution();

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

            return(operationExecution.ExecuteOperation(update));
        }
Пример #2
0
        public OperationResult Delete(Guid id)
        {
            var operationExecution = new OperationExecution();

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

            return(operationExecution.ExecuteOperation(delete));
        }
Пример #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));
        }
Пример #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));
        }
Пример #5
0
        public OperationResult Update(User user)
        {
            var operationExecution = new OperationExecution();

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

            return(operationExecution.ExecuteOperation(update));
        }
Пример #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));
        }
Пример #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));
        }