title: How to use model as parameter in method/ActionResult?
body: <p>Im trying to use model as parameter in this method but i get the error message -""No overload method for CreateGAStatisticsReport.." I know this is wrong but i'm not sure how to solve this. I need to use model as parameters to get all data needed. The problem is located in the ActionResult "GetData/CreateGAStatisticsReport".</p>
  
  <p>Here is my Controller class:</p>
  
  <pre><code> public class GAStatisticsController : Controller
      {
  
          //GET: /ShopStatistics/
          public ActionResult GetData()
          {
              return Json(CreateGAStatisticsReport(GAStatisticsListModel model), JsonRequestBehavior.AllowGet);
          }
  
  
  
          public ActionResult GAStatistics()
          {
              return View(new GAStatisticsListModel());
          }
  
  
          private List&lt;GAStatistics&gt; CreateGAStatisticsReport(GAStatisticsListModel model)
          {
  
              var serviceAccountEmail = "xxxxxxxxx@developer.gserviceaccount.com";
              var certificate = new X509Certificate2(@"C:\Users\Desktop\NopCommerce\Presentation\Nop.Web\key.p12", "notasecret", X509KeyStorageFlags.Exportable);
  
  
              var credential = new ServiceAccountCredential(
              new ServiceAccountCredential.Initializer(serviceAccountEmail)
              {
                  Scopes = new[] { AnalyticsService.Scope.Analytics }
              }.FromCertificate(certificate));
  
              // Create the service.
              //Twistandtango
              var GoogleAnalyticsService = new AnalyticsService(new BaseClientService.Initializer()
              {
                  HttpClientInitializer = credential,
                  ApplicationName = "MyApp",
              });
  
  DateTime? startDateValue = (model.StartDate == null) ? null
                           : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.StartDate.Value, _dateTimeHelper.CurrentTimeZone);
  
              DateTime? endDateValue = (model.EndDate == null) ? null
                              : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.EndDate.Value, _dateTimeHelper.CurrentTimeZone).AddDays(1);
  
              string start = model.StartDate.ToString();
              model.StartDate = DateTime.ParseExact(start, "yyyy-MM-dd", CultureInfo.InvariantCulture);
  
              string end = model.EndDate.ToString();
              model.EndDate = DateTime.ParseExact(end, "yyyy-MM-dd", CultureInfo.InvariantCulture);
  
  
  
  
  
              var request = GoogleAnalyticsService.Data.Ga.Get("ga:xxxxxxxx", start, end, "ga:visitors");
              //Specify some addition query parameters
              request.Dimensions = "ga:date";
              request.Sort = "-ga:date";
              request.MaxResults = 10000;
  
              //Execute and fetch the results of our query
              Google.Apis.Analytics.v3.Data.GaData d = request.Execute();
  
  
              List&lt;GAStatistics&gt; ListGaVisitors = new List&lt;GAStatistics&gt;();
  
              foreach (var row in d.Rows)
              {
  
                  GAStatistics GaVisits = new GAStatistics(row[0], row[1]);
                  ListGaVisitors.Add(GaVisits);
  
              }
  
  
              return ListGaVisitors;
  
          }
      }
  </code></pre>