You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How can make the Gender read from database which I have table to stored the Gender Id & Name? How to make the enum
public enum Genders
{
Female = 1,
Male = 2,
Hermaphrodite = 3
}
to be read from dataContext instead hardcoded as above?
public Dictionary<string, string> GetGendersDictionary()
{
var list = _db.Gender.Select(t => new { t.Id, t.Name })
.ToDictionary(t => t.Id.ToString(), t => t.Name.ToString());
return list;
}
@MichealeSee I'm not sure what is the actual issue you are having. My wild guess would be problem with injecting context into class providing dictionary, but I can't be sure without more details from you.
No description provided.
The text was updated successfully, but these errors were encountered: