BinaryStudio.TaskManager.Logic.Core.UserRepository.GetByName C# (CSharp) Method

GetByName() public method

The get by name.
public GetByName ( string userName ) : User
userName string /// The user name. ///
return BinaryStudio.TaskManager.Logic.Domain.User
        public User GetByName(string userName)
        {
            try
            {
                return this.dataBaseContext.Users.ToList().Single(it => it.UserName == userName);
            }
            catch (Exception)
            {
                return null;
            }
        }