converting List into IEnumerable

2010-08-12 Thread Wallace Turner
Hi, Assume the class definitions interface IOrder { } class Order : IOrder { } I understand why this doesn't compile: var list = new List(); IEnumerable iOrders = list; //IEnumerable not same type as List! So using that logic, can't understand why this *does* compile: var arr =

Re: converting List into IEnumerable

2010-08-12 Thread Michael Minutillo
Hi Wal, What version of the framework are you using. In .NET 4, both work fine. Regards, Michael M. Minutillo Indiscriminate Information Sponge Blog: http://wolfbyte-net.blogspot.com On Thu, Aug 12, 2010 at 4:31 PM, Wallace Turner wrote: > Hi, > > Assume the class definitions > > interface

RE: converting List into IEnumerable

2010-08-12 Thread Wallace Turner
3.5 SP1. Just copied it over to VS2010 (why haven't i upgraded yet!?) and it worked like you said. From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On Behalf Of Michael Minutillo Sent: Thursday, 12 August 2010 6:50 PM To: ozDotNet Subject: Re: converting List into IEnu

RE: converting List into IEnumerable

2010-08-12 Thread James Chapman-Smith
Hi Wal, With the release of .NET 4.0 the framework introduced co-variance & contra-variance on collection types. What you're trying to do is co-variance. This says that if `Order` can be assigned to `IOrder` then so too can `IEnumerable` be assigned to `IEnumerable`. Prior to .NET 4.0 you could

RE: converting List into IEnumerable

2010-08-12 Thread Wallace Turner
Thanks for the clarification. > The danger with co-variance of arrays is that you can cast an array of string to an array of object and then proceed to assign any type of object (say an int or a `Foo`) to the array resulting in a run-time error. How is that a co-variance issue? I see it more

Re: converting List into IEnumerable

2010-08-12 Thread silky
On Thu, Aug 12, 2010 at 9:58 PM, Wallace Turner wrote: > Thanks for the clarification. > > > The danger with co-variance of arrays is that you can cast an array of > > string to an array of object and then proceed to assign any type of object > > (say an int or a `Foo`) to the array resulting in a

asp.net development server visible outside network?

2010-08-12 Thread Anthony
Can i make an asp.net dev server visible outside my network. I have setup so that the dev port is static but not accessible outside my localhost. >From desktop http://localhost:5050/ works but want it accessible from http://123.45.21.x:5050/ Yes i have allowed port thru my router

RE: asp.net development server visible outside network?

2010-08-12 Thread Tiang Cheng
You'll also need to port route from 123.45.21.x:5050 to your server's IP address. From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On Behalf Of Anthony Sent: Friday, 13 August 2010 2:05 PM To: 'ozDotNet' Subject: asp.net development server visible outside network? Can

Re: asp.net development server visible outside network?

2010-08-12 Thread Michael Minutillo
The dev server only accepts connections coming from the local machine. You need some kind of proxy running on the server to forward requests to it. Like this http://ashleyangell.com/2009/03/configuring-a-basic-reverse-proxy-in-squid-on-windows-website-accelerator/