{"id":20605206,"url":"https://github.com/arnab-developer/collectionmodelbinding","last_synced_at":"2026-06-05T19:31:06.522Z","repository":{"id":68915003,"uuid":"252918948","full_name":"Arnab-Developer/CollectionModelBinding","owner":"Arnab-Developer","description":"Collection model binding with asp.net core.","archived":false,"fork":false,"pushed_at":"2021-04-09T11:53:19.000Z","size":671,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-06T16:54:52.445Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Arnab-Developer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-04T05:43:16.000Z","updated_at":"2021-12-05T05:48:16.000Z","dependencies_parsed_at":"2023-02-23T01:00:24.895Z","dependency_job_id":null,"html_url":"https://github.com/Arnab-Developer/CollectionModelBinding","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Arnab-Developer/CollectionModelBinding","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arnab-Developer%2FCollectionModelBinding","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arnab-Developer%2FCollectionModelBinding/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arnab-Developer%2FCollectionModelBinding/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arnab-Developer%2FCollectionModelBinding/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Arnab-Developer","download_url":"https://codeload.github.com/Arnab-Developer/CollectionModelBinding/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arnab-Developer%2FCollectionModelBinding/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33957496,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-05T02:00:06.157Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T09:27:06.797Z","updated_at":"2026-06-05T19:31:06.507Z","avatar_url":"https://github.com/Arnab-Developer.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ASP.NET Core model binding with collection\n\n`SessionController` `Index` method is sending a `Student` collection to view.\n\n```csharp\npublic IActionResult Index()\n{\n    var s = new Session()\n    {\n        Id = 1,\n        Name = \"session1\",\n        Students = new List\u003cStudent\u003e()\n        {\n            new Student()\n            {\n                Id = 1,\n                Name = \"student1\"\n            },\n            new Student()\n            {\n                Id = 2,\n                Name = \"student2\"\n            }\n        }\n    };\n    return View(s);\n}\n```\n\nIn the view it uses the ASP.NET model binding to post data into `Create` method.\n\n```html\n\u003cform asp-action=\"Create\" asp-controller=\"Session\" method=\"post\"\u003e\n    \u003cinput type=\"text\" asp-for=\"Id\" /\u003e\u003cbr /\u003e\n    \u003cinput type=\"text\" asp-for=\"Name\" /\u003e\u003cbr /\u003e\n\n    @for(var i = 0; i \u003c Model.Students.Count; i++)\n    {\n        \u003cinput type=\"text\" asp-for=\"@Model.Students[i].Id\" /\u003e\u003cbr /\u003e\n        \u003cinput type=\"text\" asp-for=\"@Model.Students[i].Name\" /\u003e\u003cbr /\u003e\n    }\n\n    \u003cinput type=\"submit\" value=\"Create session\" /\u003e\n\u003c/form\u003e\n```\n\n```csharp\npublic IActionResult Create(Session s)\n{\n    return View();\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farnab-developer%2Fcollectionmodelbinding","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farnab-developer%2Fcollectionmodelbinding","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farnab-developer%2Fcollectionmodelbinding/lists"}