From: AMP on
Hello,
This looks like an interface as a field or property:
public class AccountController : Controller
{

public IFormsAuthenticationService FormsService { get; set; }
public IMembershipService MembershipService { get; set; }

protected override void Initialize(RequestContext
requestContext)................


What am I missing?
From: Arne Vajhøj on
On 10-05-2010 17:53, AMP wrote:
> This looks like an interface as a field or property:
> public class AccountController : Controller
> {
>
> public IFormsAuthenticationService FormsService { get; set; }
> public IMembershipService MembershipService { get; set; }
>
> protected override void Initialize(RequestContext
> requestContext)................
>
> What am I missing?

A question maybe?

:-)

There is nothing wrong by having a property of a type that
is an interface.

Arne

From: AMP on
On May 10, 5:55 pm, Arne Vajhøj <a...(a)vajhoej.dk> wrote:
> On 10-05-2010 17:53, AMP wrote:
>
> > This looks like an interface as a field or property:
> >           public class AccountController : Controller
> >      {
>
> >          public IFormsAuthenticationService FormsService { get; set; }
> >          public IMembershipService MembershipService { get; set; }
>
> >          protected override void Initialize(RequestContext
> > requestContext)................
>
> > What am I missing?
>
> A question maybe?
>
> :-)
>
> There is nothing wrong by having a property of a type that
> is an interface.
>
> Arne

Thanks Arne, but where can I find some MSDN documentation for this, I
havent seen it before?
From: Arne Vajhøj on
On 10-05-2010 18:16, AMP wrote:
> On May 10, 5:55 pm, Arne Vajh�j<a...(a)vajhoej.dk> wrote:
>> On 10-05-2010 17:53, AMP wrote:
>>
>>> This looks like an interface as a field or property:
>>> public class AccountController : Controller
>>> {
>>
>>> public IFormsAuthenticationService FormsService { get; set; }
>>> public IMembershipService MembershipService { get; set; }
>>
>>> protected override void Initialize(RequestContext
>>> requestContext)................
>>
>>> What am I missing?
>>
>> A question maybe?
>>
>> :-)
>>
>> There is nothing wrong by having a property of a type that
>> is an interface.
>
> Thanks Arne, but where can I find some MSDN documentation for this, I
> havent seen it before?

The docs say that it can be of a type. An interface is a type. Most
likely noone considered it necessary to say that type includes
interfaces.

Arne

From: Family Tree Mike on
On 5/10/2010 6:16 PM, AMP wrote:
> On May 10, 5:55 pm, Arne Vajh�j<a...(a)vajhoej.dk> wrote:
>> On 10-05-2010 17:53, AMP wrote:
>>
>>> This looks like an interface as a field or property:
>>> public class AccountController : Controller
>>> {
>>
>>> public IFormsAuthenticationService FormsService { get; set; }
>>> public IMembershipService MembershipService { get; set; }
>>
>>> protected override void Initialize(RequestContext
>>> requestContext)................
>>
>>> What am I missing?
>>
>> A question maybe?
>>
>> :-)
>>
>> There is nothing wrong by having a property of a type that
>> is an interface.
>>
>> Arne
>
> Thanks Arne, but where can I find some MSDN documentation for this, I
> havent seen it before?

All it means is that any object implementing the IMembershipServices
interface, can be assigned to the FormsService property. The class
AccountController doesn't care about the property beyond the interface,
so it's more flexible about the objects you can pass to it.
--
Mike