Thanks, I'll have to research IEnumerable a bit more to really get this. I guess I also don't understand how it's returning an IEnumerable<> besides the method signature saying it's returning an IEnumerable when it's showing me that it's returning a generic
list of IRole. So somehow the compiler pushes in An IEnumerable<IRole>...I just don't get that. The return statement in that method is saying it's returning List<IRole> but method signature doesn't say List<IRole> it says IEnumerable. What are the symantics
of that?
But moving on, I now get this:
hhDbRoleProvider roleProvider;
List<xxx.BusinessInterfaces.Security.IRole> hhRoles =
new
List<xxx.BusinessInterfaces.Security.IRole>(roleProvider.RetrieveAllRoles());
I also tried:
hhDbRoleProvider roleProvider;
List<xxx.BusinessInterfaces.Security.IRole> hhRoles =
new
List<xxx.BusinessInterfaces.Security.IRole>();
dba123
Contributor
2726 Points
1364 Posts
Re: Cannot implicitly convert type 'System.Collections.Generic.IEnumerable<xxx>' to 'System.Colle...
May 23, 2008 09:22 PM|LINK
Thanks, I'll have to research IEnumerable a bit more to really get this. I guess I also don't understand how it's returning an IEnumerable<> besides the method signature saying it's returning an IEnumerable when it's showing me that it's returning a generic list of IRole. So somehow the compiler pushes in An IEnumerable<IRole>...I just don't get that. The return statement in that method is saying it's returning List<IRole> but method signature doesn't say List<IRole> it says IEnumerable. What are the symantics of that?
But moving on, I now get this:
hhDbRoleProvider roleProvider; List<xxx.BusinessInterfaces.Security.IRole> hhRoles = new List<xxx.BusinessInterfaces.Security.IRole>(roleProvider.RetrieveAllRoles());I also tried:
hhDbRoleProvider roleProvider; List<xxx.BusinessInterfaces.Security.IRole> hhRoles = new List<xxx.BusinessInterfaces.Security.IRole>();hhRoles = (
List<xxx.BusinessInterfaces.Security.IRole>)roleProvider.RetrieveAllRoles();Either way I still get this error: Use of unassigned local variable 'roleProvider'
What is it talking about, I DID use it.