public IQueryable <HsrOrderApp.BL.DomainModel.User> GetAllUsers()
        {
            var users = from u in this.db.Users
                        select SecurityAdapter.AdaptUser(u);

            return(users);
        }
Exemplo n.º 2
0
        public IQueryable <HsrOrderApp.BL.DomainModel.User> GetAllUsers()
        {
            var users = from u in this.db.UserSet.Include("Roles").AsEnumerable()
                        select SecurityAdapter.AdaptUser(u);

            return(users.AsQueryable());
        }
        public HsrOrderApp.BL.DomainModel.User GetUserByUsername(string username)
        {
            try
            {
                var users = from u in this.db.Users
                            where u.Username == username
                            select SecurityAdapter.AdaptUser(u);

                return(users.First());
            }
            catch (ArgumentNullException ex)
            {
                if (ExceptionPolicy.HandleException(ex, "DA Policy"))
                {
                    throw;
                }
                return(new MissingUser());
            }
        }
Exemplo n.º 4
0
        public HsrOrderApp.BL.DomainModel.User GetUserById(int id)
        {
            try
            {
                var users = from u in this.db.UserSet.Include("Roles").Include("Customer").AsEnumerable()
                            where u.UserId == id
                            select SecurityAdapter.AdaptUser(u);

                return(users.First());
            }
            catch (ArgumentNullException ex)
            {
                if (ExceptionPolicy.HandleException(ex, "DA Policy"))
                {
                    throw;
                }
                return(new MissingUser());
            }
        }
Exemplo n.º 5
0
        public HsrOrderApp.BL.DomainModel.User GetUserByUsername(string username)
        {
            try
            {
                var users = from u in this.db.UserSet.Include("Roles").AsEnumerable()
                            where String.Equals(u.Username, username, StringComparison.OrdinalIgnoreCase)
                            select SecurityAdapter.AdaptUser(u);



                return(users.First());
            }
            catch (ArgumentNullException ex)
            {
                if (ExceptionPolicy.HandleException(ex, "DA Policy"))
                {
                    throw;
                }
                return(new MissingUser());
            }
        }