using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RDH.Data.Models;

namespace RDH.Data.BLL
{

	public partial class RoleBLL  :   IRoleBLL
	{
        public IEnumerable<Role> ListRole()
        {
            var sql = BuildBaseSql();
            var RoleList = SqlMapper.Query<Role>(ConnectionFactory.Current.GetSessionConnection(), sql, null);

            return RoleList;
        }


        public Role GetRoleByName(Role roleByName)
        {
            var param = GetParam(roleByName);
            string sql=string.Format("{0}  WHERE NAME=:Name_", this.BuildBaseSql());


            return SqlMapper.Query<Role>(ConnectionFactory.Current.GetSessionConnection(), sql, param).FirstOrDefault();
        }
    }

}