0

Is there a way to generate a url with T4MVC with a parameter of list? Right now it gives me this.

  public virtual ActionResult Scoresheets(int? eventId, int? gameId, List<int> gameIds)
        {

Url.ActionAbsolute(MVC.EventReports.Scoresheets(eventId, gameId, gameIds))


http://localhost:2222/24086/event/documents/scoresheets?gameids=system.collections.generic.list%601%5bsystem.int32%5d
Mike Flynn
  • 22,342
  • 54
  • 182
  • 341

1 Answers1

0

What URL are you expecting here? e.g. a comma separated list of id's?

One option may be to write a Model Unbinder, as described in section 3.1 of the doc.

David Ebbo
  • 42,443
  • 8
  • 103
  • 117
  • Well since ASP.NET MVC can only handle ?gameIds=1001&gameIds=1005 I guess that would be it. – Mike Flynn Jul 25 '14 at 20:21
  • I thought about returning an anonymous type with a method on that object, in this case an extension method for a list for T4MVC and pass it as an anonymous type, kind of like this http://bntr.wordpress.com/2011/10/23/asp-mvc-passing-an-object-to-an-action-using-t4mvc-strongly-typed-actions/ – Mike Flynn Jul 25 '14 at 20:23
  • Did you try using a Model Unbinder? I would think it could handle this. – David Ebbo Jul 31 '14 at 07:49