public MemberViewModel GetByUsername(string username) { var user = mrp.GetByUsername(username); if (user != null) { var returnItem = new MemberViewModel { Username = user.Username, Password = user.Password, MemberType = user.MemberTypeId, MemberId = user.MemberId }; return(returnItem); } return(null); }