Example #1
0
        public APIResult<List<Event>> Events(ApplicationCredentialsModel model)
        {
            try
            {
                if (model == null)
                    throw new Exception("Please pass model");

                using (var bo = new ApplicationBusinessObject())
                {
                    if (!bo.Check(model.ApplicationId, model.ApplicationSecretKey))
                        throw new Exception("Invalid application credentials");
                }

                using (var bo = new EventBusinessObject())
                {
                    var result = bo.GetList();

                    return new APIResult<List<Event>>(result);
                }

            }
            catch (Exception ex)
            {
                return new APIResult<List<Event>>(ex.Message, ex.ToString());
            }
        }