[CSHARP-957] MongoLab collection cannot be downloaded from MVC 4 Web API Created: 20/Apr/14 Updated: 05/Apr/19 Resolved: 20/Apr/14 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Ricardo Sanchez | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | question | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows 7 Ultimate, Visual Studio 2012 |
||
| Attachments: |
|
| Description |
|
The download starts, but it cannot be saved to PC's directory. |
| Comments |
| Comment by Craig Wilson [ 25/Apr/14 ] |
|
API docs are here: http://api.mongodb.org/csharp/current/ In addition, in Visual Studio, you could always hit F12 on the type in order to go its definition. |
| Comment by Ricardo Sanchez [ 25/Apr/14 ] |
|
Craig, Thanks for your fast response. Ricardo Sanchez |
| Comment by Craig Wilson [ 20/Apr/14 ] |
|
Hi Ricardo, However, since we are here, I'm happy to help. I pulled down your code and see your mistake immediately. A MongoCollection does not implement IEnumerable. Line 29 of SchoolController is attempting to cast it to an IEnumerable, which will always result in collection being null. You should use the FindAll() method on collection. Craig |