Created
January 30, 2016 11:36
-
-
Save KennethanCeyer/950972f65c4df95732b2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UserTable { | |
public int user_pk { get; set; } | |
public int user_age { get; set; } | |
public string user_name { get; set; } | |
public Datetime user_birth { get; set; } | |
public UserGenderFlag user_gender { get; set; } | |
} | |
public enum UserGenderFlag { | |
Man, | |
Woman | |
} | |
public UserTable GetUser(int user_pk) { | |
using(var db = new dbEntity()) { | |
UserTable user = db.user_tbl.Where(x => x.user_pk == user_pk).FirstOrDefault(); | |
if(user != null) { | |
return user; | |
} else { | |
return false; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment