public string[] GetRolesForUser(string userName) { // User user = db.api_login.FirstOrDefault(u => u.username.Equals(userName, StringComparison.CurrentCultureIgnoreCase)); //|| u.Email.Equals(username, StringComparison.CurrentCultureIgnoreCase)); var roles = from r in db.api_login where r.role == r.ID && r.username == userName select r.role; if (roles != null) return roles.ToArray(); else return new string[] { }; ; }
public partial class api_login { public string ID { get; set; } public string username { get; set; } public string password { get; set; } public string description { get; set; } public string role { get; set; } }
where r.role == r.ID &&
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)