C# Accessing dynamic property on interface

Viewed 1162

I am playing around with FluentSecurity library for asp.net mvc. One of the interfaces exposed by this library is ISecurityContext as shown below:

public interface ISecurityContext
{
    dynamic Data { get; }
    bool CurrenUserAuthenticated();
    IEnumerable<object> CurrenUserRoles();
}

When I try to access "Data" property (as shown below) it is not available. Although the other two methods seems to be accessible.

public class ExperimentalPolicy : ISecurityPolicy
{
    public PolicyResult Enforce(ISecurityContext context)
    {
        dynamic data = context.Data; // Data property is not accessible.
    }
}

What am I missing ? Thanks.

2 Answers
Related