public GetFeatureQueryResult Retrieve(GetFeatureByIdQuery query)
        {
            Feature feature = this.ReadRepository.GetById(query.FeatureId);
            GetFeatureQueryResult result = new GetFeatureQueryResult(feature.Id, feature.Name, feature.UserId, feature.Ticket, feature.IsActive, feature.IsEnabled, feature.StrategyId);

            return(result);
        }
        public Feature Get(string id)
        {
            GetFeatureByIdQuery query = new GetFeatureByIdQuery(id);

            GetFeatureQueryResult queryResult = this.queryDispatcher.Dispatch <GetFeatureByIdQuery, GetFeatureQueryResult, Feature>(query);

            Feature result = new Feature(queryResult.Id, queryResult.DateAdded, queryResult.Name, queryResult.UserId, queryResult.Ticket, queryResult.IsActive, queryResult.IsEnabled, queryResult.StrategyId);

            return(result);
        }
Exemple #3
0
        public FeatureVm GetFeatureById(GetFeatureByIdQuery query)
        {
            if (query == null)
            {
                throw new ArgumentNullException(string.Format(MessagesModel.NullValueError, "query"));
            }

            GetFeatureQueryResult result = this.queryDispatcher.Dispatch <GetFeatureByIdQuery, GetFeatureQueryResult, Feature>(query);

            FeatureVm vm = FeatureModelHelper.QueryResultToFeatureVm(result);

            return(vm);
        }
Exemple #4
0
        private void BindFormValues()
        {
            string id = Request.QueryString["id"];
            GetFeatureByIdQuery query = new GetFeatureByIdQuery(id);

            this.Vm = this.model.GetFeatureById(query);

            this.FeatureId.Text             = this.Vm.Id;
            this.FeatureName.Text           = this.Vm.Name;
            this.FeatureTicket.Text         = this.Vm.Ticket;
            this.FeatureOwner.SelectedValue = this.Vm.UserId;
            this.FeatureActive.Checked      = this.Vm.IsActive;
            this.FeatureEnabled.Checked     = this.Vm.IsEnabled;
            this.FeatureDateAdded.Text      = this.Vm.DateAdded.ToShortDateString();
        }
Exemple #5
0
        public async Task <IActionResult> EditFeature(long id)
        {
            var gfbivm = new GetFeatureByIdQuery()
            {
                Id = id
            };

            var f = await _qpa.ProcessAsync(gfbivm);

            if (f != null)
            {
                return(View(new FeatureViewModel()
                {
                    Id = f.Id, Title = f.Title, Description = f.Description
                }));
            }
            else
            {
                // need better exception and error handling
                return(NotFound());
            }
        }