public string UserInfoMethod(string accessToken) { foreach (var el in availableUsers) { if (el.Token == accessToken) { if (el.ExpDate > DateTime.Now) { UserInfoC info = new UserInfoC(); info.Name = el.UName; info.LastName = el.ULastName; return(JsonConvert.SerializeObject(info)); } else { string error = "error:Token Data was expiried"; return(JsonConvert.SerializeObject(error)); } } } string error2 = "error:Not correct access token"; return(JsonConvert.SerializeObject(error2)); }
public string UserInfoMethod(string accessToken) { foreach (var el in availableUsers) { if (el.Token == accessToken && el.ExpDate > DateTime.Now) { UserInfoC info = new UserInfoC(); info.Name = el.UName; info.LastName = el.ULastName; return(JsonConvert.SerializeObject(info)); } } return(null); }
public string UserInfoMethod(string accessToken) { foreach (var el in availableUsers) { if (el.Token == accessToken) { if (el.ExpDate > DateTime.Now) { UserInfoC info = new UserInfoC(); info.Name = el.UName; info.LastName = el.ULastName; return JsonConvert.SerializeObject(info); } else { string error = "error:Token Data was expiried"; return JsonConvert.SerializeObject(error); } } } string error2 = "error:Not correct access token"; return JsonConvert.SerializeObject(error2); }
public string UserInfoMethod(string accessToken) { foreach (var el in availableUsers) { if (el.Token == accessToken && el.ExpDate > DateTime.Now) { UserInfoC info = new UserInfoC(); info.Name = el.UName; info.LastName = el.ULastName; return JsonConvert.SerializeObject(info); } } return null; }