Original Message-
> From: Discussion of advanced .NET topics. [mailto:ADVANCED-
> [EMAIL PROTECTED] On Behalf Of Bob Provencher
> Sent: Friday, December 14, 2007 1:58 PM
> To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
> Subject: Re: [ADVANCED-DOTNET] Method that returns List
>
> I t
OTNET@DISCUSS.DEVELOP.COM
Subject: Re: [ADVANCED-DOTNET] Method that returns List
> Anyways, we have a service contract for IReporting, and a ReportManager
> implementation class.
>
> public IList GetReport(string reportName, Criteria c);
Rather than exposing and requiring a base class,
On 12/14/07, Marc Brooks <[EMAIL PROTECTED]> wrote:
>
> Eric Lippert (CLR ninja at Microsoft) has been writing a facination
> series of blog posts about the current and (possible) future support
> for these very concepts in an upcoming release of the CLR. I recommend
> the series AND the comments a
> Anyways, we have a service contract for IReporting, and a ReportManager
> implementation class.
>
> public IList GetReport(string reportName, Criteria c);
Rather than exposing and requiring a base class, you should REALLY
expose an interface for your contract. That way nobody _has_ to
inherit
Eric Lippert (CLR ninja at Microsoft) has been writing a facination
series of blog posts about the current and (possible) future support
for these very concepts in an upcoming release of the CLR. I recommend
the series AND the comments as excellent learning fodder.
http://blogs.msdn.com/ericlipper
to
one of our data contract types.
From: Discussion of advanced .NET topics. [EMAIL PROTECTED] On Behalf Of Ryan
Heath [EMAIL PROTECTED]
Sent: Friday, December 14, 2007 1:28 PM
To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
Subject: Re: [ADVANCED-DOTNET] Method that returns List
Make the ctor static
Dispose();
>
>return resultset;
>}
>}
>
> ____________
> From: Discussion of advanced .NET topics. [EMAIL PROTECTED] On Behalf Of Bob
> Provencher [EMAIL PROTECTED]
> Sent: Friday, December 14, 2007 12:58 PM
>
>
@DISCUSS.DEVELOP.COM
Subject: Re: [ADVANCED-DOTNET] Method that returns List
I think that if you add a different kind of report in the GetReports()
method it might through an error though
public List GetReports()
{
List reports = new List();
reports.Add(new Report
return resultset;
}
}
From: Discussion of advanced .NET topics. [EMAIL PROTECTED] On Behalf Of Bob
Provencher [EMAIL PROTECTED]
Sent: Friday, December 14, 2007 12:58 PM
To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
Subject: Re: [ADVANCED-DOTNET] Method that
PM
To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
Subject: Re: [ADVANCED-DOTNET] Method that returns List
Indeed it does. Thank you.
I was under the impression that if the method that returned derived reports
ultimately returned a list of the base report, then the client would get the
properties defined i
OTNET@DISCUSS.DEVELOP.COM
Subject: Re: [ADVANCED-DOTNET] Method that returns List
I believe if you change your List (inside of GetReports()) to
type List it might work...
Brandon
Ron Young wrote:
Is the following possible? The compiler tells me no:
class Report
{
}
class ReportA : Report
{
public s
:51 PM
To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
Subject: Re: [ADVANCED-DOTNET] Method that returns List
On 12/14/07, Ron Young <[EMAIL PROTECTED]> wrote:
> Is the following possible? The compiler tells me no:
>
> public List GetReports()
> {
>Li
On 12/14/07, Ron Young <[EMAIL PROTECTED]> wrote:
> Is the following possible? The compiler tells me no:
>
> public List GetReports()
> {
>List reports = new List();
>reports.Add(new Report());
>return reports;
> }
Covariance is not supported for gen
Sent: Friday, December 14, 2007 12:44 PM
To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
Subject: Re: [ADVANCED-DOTNET] Method that returns List
I believe if you change your List (inside of GetReports()) to
type List it might work...
Brandon
Ron Young wrote:
> Is the following possible? The compiler
I believe if you change your List (inside of GetReports()) to
type List it might work...
Brandon
Ron Young wrote:
Is the following possible? The compiler tells me no:
class Report
{
}
class ReportA : Report
{
public string MyName = "ReportA";
}
class ReportProvider
{
public List Ge
Is the following possible? The compiler tells me no:
class Report
{
}
class ReportA : Report
{
public string MyName = "ReportA";
}
class ReportProvider
{
public List GetReports()
{
List reports = new List();
reports.Add(new Report());
return rep
16 matches
Mail list logo