コード例 #1
0
ファイル: Users_APIs.cs プロジェクト: SalmaAssem/WinJiGoTask
        public static async Task <XWinji.Models.LMSApplicationCoreViewModelUserViewModel> Get_UserInfo(List <System.Net.Cookie> cookies)
        {
            var baseAddress     = new Uri(URLs.URL);
            var cookieContainer = new CookieContainer();

            cookies.ForEach(cookieContainer.Add);
            var handler = new HttpClientHandler()
            {
                CookieContainer = cookieContainer
            };

            using (XWinji.LMSWebCore client = new XWinji.LMSWebCore(baseAddress, handler))
            {
                var data = new XWinji.Models.LMSApplicationCoreViewModelUserBasicInfoViewModel
                {
                };

                var customHeaders = new Dictionary <string, List <string> >();
                customHeaders.Add("X-Requested-With", new List <string>()
                {
                    "XMLHttpRequest"
                }); customHeaders.Add("x-language-header", new List <string>()
                {
                    ""
                });
                var response = await client.UserApi.GetCurrentUserInfoWithHttpMessagesAsync(customHeaders);

                return(response.Body);
            }
        }
 /// <summary>
 /// Initializes a new instance of the
 /// LMSApplicationCoreViewModelUserViewModel class.
 /// </summary>
 public LMSApplicationCoreViewModelUserViewModel(LMSApplicationCoreViewModelUserBasicInfoViewModel basicProfileInfo = default(LMSApplicationCoreViewModelUserBasicInfoViewModel), LMSApplicationCoreViewModelUserSettingsViewModel settings = default(LMSApplicationCoreViewModelUserSettingsViewModel), IList <LMSDomainCoreModelsUserRoleInfo> userRolesSchools = default(IList <LMSDomainCoreModelsUserRoleInfo>), bool?isGradebookEnabled = default(bool?), bool?isGradebookCustomizationEnabled = default(bool?), bool?isAttendanceEnabled = default(bool?))
 {
     BasicProfileInfo   = basicProfileInfo;
     Settings           = settings;
     UserRolesSchools   = userRolesSchools;
     IsGradebookEnabled = isGradebookEnabled;
     IsGradebookCustomizationEnabled = isGradebookCustomizationEnabled;
     IsAttendanceEnabled             = isAttendanceEnabled;
     CustomInit();
 }