Click here to Skip to main content
15,889,462 members
Home / Discussions / WPF
   

WPF

 
QuestionCovariance-Contravariance help please! Pin
DotNetXenon23-Sep-11 4:02
DotNetXenon23-Sep-11 4:02 
AnswerRe: Covariance-Contravariance help please! Pin
Mycroft Holmes23-Sep-11 12:18
professionalMycroft Holmes23-Sep-11 12:18 
QuestionWCF service call in which layer? Pin
DotNetXenon22-Sep-11 8:32
DotNetXenon22-Sep-11 8:32 
AnswerRe: WCF service call in which layer? Pin
Mycroft Holmes22-Sep-11 12:50
professionalMycroft Holmes22-Sep-11 12:50 
GeneralRe: WCF service call in which layer? Pin
DotNetXenon23-Sep-11 8:07
DotNetXenon23-Sep-11 8:07 
AnswerRe: WCF service call in which layer? Pin
Abhinav S24-Sep-11 21:34
Abhinav S24-Sep-11 21:34 
QuestionWCF Service list Pin
DotNetXenon22-Sep-11 5:47
DotNetXenon22-Sep-11 5:47 
AnswerRe: WCF Service list Pin
Jürgen Röhr22-Sep-11 8:02
professionalJürgen Röhr22-Sep-11 8:02 
Hi,

"List" is a generic type which means, it provides functionality, which can be applied to abitrary (other) types. That's why you can't have "List" as the return type of a webservice (or just any method), but List<T> where "T" is another type.

If you have two instances of List<T> and the involded "T"s are different, the List-types are not convertible (neither implicitly nor explicitly). So, if you have
List<User> lstUser = new List<User>();
you can't assign the result of
C#
List<Employee> lstEmployee = EmployeeSrvc.GetEmployeeDetails();
This is true for .Net until 3.5; in .Net 4 MS has made some improvements. Just search for "covariance"/"contravariance".

If "Emplpoyee" and "User" have the same properties, you should just use one class (e. g. "Person").

Another possible solution could be to loop through the results of the service (employees) and create and add new users.

Cheers
Jürgen
If this answer saves you some time, please spend a bit of it to vote.

GeneralRe: WCF Service list Pin
DotNetXenon22-Sep-11 8:13
DotNetXenon22-Sep-11 8:13 
Questionproblem in showing x-axix value in multi series line chart in silverlight4 Pin
Mann Saini22-Sep-11 3:12
Mann Saini22-Sep-11 3:12 
QuestionOpen a XAML page from aspx page Pin
yesu prakash21-Sep-11 20:30
yesu prakash21-Sep-11 20:30 
AnswerRe: Open a XAML page from aspx page Pin
RichardGrimmer22-Sep-11 5:14
RichardGrimmer22-Sep-11 5:14 
QuestionSL Content not displaying Pin
JMurfey20-Sep-11 9:58
JMurfey20-Sep-11 9:58 
AnswerRe: SL Content not displaying Pin
DotNetXenon23-Sep-11 4:19
DotNetXenon23-Sep-11 4:19 
GeneralRe: SL Content not displaying Pin
JMurfey23-Sep-11 12:57
JMurfey23-Sep-11 12:57 
GeneralRe: SL Content not displaying Pin
JMurfey26-Sep-11 10:15
JMurfey26-Sep-11 10:15 
QuestionDynamicly load DLL's Pin
columbos1492718-Sep-11 22:54
columbos1492718-Sep-11 22:54 
AnswerRe: Dynamicly load DLL's Pin
Daniel.Grondal19-Sep-11 23:31
Daniel.Grondal19-Sep-11 23:31 
Question"XmlDataProvider has inline XML that does not explicitly set its XmlNamespace (xmlns="")" Pin
devvvy18-Sep-11 16:41
devvvy18-Sep-11 16:41 
AnswerRe: "XmlDataProvider has inline XML that does not explicitly set its XmlNamespace (xmlns="")" Pin
Mamta D19-Sep-11 18:29
Mamta D19-Sep-11 18:29 
AnswerRe: ToString vs Simple DataTemplate Pin
SledgeHammer0115-Sep-11 13:10
SledgeHammer0115-Sep-11 13:10 
GeneralRe: ToString vs Simple DataTemplate Pin
Member 103390715-Sep-11 22:47
Member 103390715-Sep-11 22:47 
AnswerRe: ToString vs Simple DataTemplate Pin
Kim Breugelmans15-Sep-11 22:54
Kim Breugelmans15-Sep-11 22:54 
AnswerRe: ToString vs Simple DataTemplate Pin
Member 103390715-Sep-11 22:57
Member 103390715-Sep-11 22:57 
GeneralRe: ToString vs Simple DataTemplate Pin
Member 103390717-Sep-11 9:34
Member 103390717-Sep-11 9:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.