예제 #1
0
 /// <summary>
 /// Returns true if email is already taken. Not case sensitive
 /// </summary>
 /// <param name="context"></param>
 /// <param name="email"></param>
 /// <returns></returns>
 public async static Task<bool> IsEmailTaken(GameContext context, string email)
 {
     return await context.Members.Where(m => m.EmailAddress == email.Trim()).AnyAsync();
 }
예제 #2
0
 /// <summary>
 ///  Adds a member to the database. Returns the member with their MemberId populated
 /// </summary>
 /// <param name="context">The database context to be used</param>
 /// <param name="m">The new Member to be added</param>
 /// <returns></returns>
 public async static Task<Member> Add(GameContext context, Member m)
 {
     context.Members.Add(m);
     await context.SaveChangesAsync();
     return m;
 }
예제 #3
0
 /// <summary>
 /// Returns true if username is a already taken.
 /// </summary>
 /// <param name="context"></param>
 /// <param name="username"></param>
 /// <returns></returns>
 public async static Task<bool> isUsernameTaken(GameContext context, string username)
 {
     return await context.Members.Where(m => m.Username == username.Trim()).AnyAsync();
 }