/* * This method is critical for build. Have to be able to create a * VolunteerUser with UserName as argument. This was necessary to be able * to GetUserByUserName (see above method). * Arguments: UserName */ public void CreateVolunteerUser(string UserName) { var user = GetAppUserByUserName(UserName); var VolUser = new VolunteerUser(); VolUser.BaseUser = user; Context.VolunteerUsers.Add(VolUser); Context.SaveChanges(); }
/*This method is a way to see if the UserName exists in the database. * Arguments: e */ public bool UsernameExists(string e) { VolunteerUser found_User = Context.VolunteerUsers.FirstOrDefault(s => s.BaseUser.UserName.ToLower() == e.ToLower()); if (found_User != null) { return(true); } return(false); }