Free cookie consent management tool by TermsFeed Policy Generator

source: branches/OaaS/HeuristicLab.Services.Optimization.Web/Models/OptimizationModels.cs @ 8384

Last change on this file since 8384 was 8384, checked in by fschoepp, 12 years ago

#1888:

  • Created a project which contains the back-end controller for the Optimization WebSite
  • Added a WCF-back-end-controller which generates all available optimization problems (currently in-memory solution: PlaceholderControllerService.cs)
  • Created a WebRole using ASP.NET MVC 3 for the Optimization Web Site
  • WebSite authenticates users with the HeuristicLab.Authentication membership provider and database
  • WebSite crawls and displays all available optimization scenarios by using the WCF-back-end controller (test with: http://localhost:.../optimization)
File size: 880 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Web;
5using System.Web.Mvc;
6using HeuristicLab.Services.Optimization.ControllerService.Model;
7
8namespace HeuristicLab.Services.Optimization.Web.Models {
9  public class OptimizationModelBinder : IModelBinder {
10    public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) {
11      var scenario = new Optimization.ControllerService.Model.OptimizationScenario();
12      foreach (var key in controllerContext.RequestContext.HttpContext.Request.Form.AllKeys) {
13        var value = bindingContext.ValueProvider.GetValue(key);       
14        scenario.InputParameters.Add(new HeuristicLab.Services.Optimization.ControllerService.Model.Parameter() { });
15      }
16      return new Optimization.ControllerService.Model.OptimizationScenario();
17    }
18  }
19}
Note: See TracBrowser for help on using the repository browser.