Beispiel #1
0
    public IHttpActionResult Get(int eventId)
    {
        string userKey = this.Request.Headers.GetValues("uk").FirstOrDefault();
        bool   auth    = false;

        using (UserContext userContext = new UserContext())
        {
            auth = userContext.Authenticate(userKey);
        }

        if (auth && eventId > 0)
        {
            Event getEvent = EventContext.Get(eventId);

            return(Ok(getEvent));
        }

        return(Ok("Unauthorized"));
    }
Beispiel #2
0
        Event InterfaceEvent.GetEvent(string location, string name)
        {
            EventContext eventContext = new EventContext();

            return(eventContext.Get(location, name));
        }