コード例 #1
0
        public static async Task <List <AlertCategory> > GetAlertCategories()
        {
            try
            {
                var alertCategoriesString = await MaestroHttpClientRequest.GetAsync(apiAlertCatergories);

                var alertCategoriesObject = JsonConvert.DeserializeObject <List <AlertCategory> >(alertCategoriesString);
                return(alertCategoriesObject);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #2
0
        public static async Task <AlertNewsFeed> GetAlertById(int appliedEntityId, int alertId)
        {
            try
            {
                string _apiRelativeUrl     = string.Format(apiAlertNewsFeedDetails, appliedEntityId, alertId);
                var    alertNewsFeedString = await MaestroHttpClientRequest.GetAsync(_apiRelativeUrl);

                var alertNewsFeedObject = JsonConvert.DeserializeObject <AlertNewsFeed>(alertNewsFeedString);
                return(alertNewsFeedObject);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #3
0
        /// <summary>
        /// Gets the logged in user info.
        /// </summary>
        /// <returns>The logged in user info.</returns>
        public static async Task <UserProfile> GetLoggedInUserInfo()
        {
            try
            {
                // Calling the Get Request to Get the User Logged in User Info
                var userInfoString = await MaestroHttpClientRequest.GetAsync(apiUserInfoRelativePath);

                // Converting the String response to Object
                var userInfoObject = JsonConvert.DeserializeObject <UserProfile>(userInfoString);

                // Returning the data
                return(userInfoObject);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }