Click here to Skip to main content
15,907,497 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ,


using System;

C#
namespace Microsoft.AspNet.Identity
{
    // Summary:
    //     Minimal interface for a user with a string user key
    public interface IUser
    {
        // Summary:
        //     Unique key for the user
        //
        // Returns:
        //     The unique key for the user
        string Id { get; }
        string UserName { get; set; }
    }
}


we can declare only constant in interface
can any one explain above code
Posted
Updated 21-Dec-15 22:58pm
v2

1 solution

Quote:
we can declare only constant in interface
No.

Please note interfaces are well documented, see "Interfaces (C# Programming Guide)"[^].

The code you posted defines an interface having two properties, namely the read-only Id and the read/write UserName.
 
Share this answer
 
Comments
[no name] 22-Dec-15 6:30am    
A 5.
CPallini 23-Dec-15 3:04am    
Thank you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900