public IActionResult Post([FromBody] RoleViewModel roleViewModel)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    if (_role.CheckRoleExits(roleViewModel.RoleName))
                    {
                        return(Conflict("The same role name already exists."));
                    }
                    else
                    {
                        var temprole = AutoMapper.Mapper.Map <Role>(roleViewModel);

                        _role.InsertRole(temprole);

                        return(Ok(true));
                    }
                }
                return(BadRequest());
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
        public HttpResponseMessage Post([FromBody] RoleViewModel roleViewModel)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    if (_role.CheckRoleExits(roleViewModel.RoleName))
                    {
                        var response = new HttpResponseMessage()
                        {
                            StatusCode = HttpStatusCode.Conflict
                        };

                        return(response);
                    }
                    else
                    {
                        var temprole = AutoMapper.Mapper.Map <Role>(roleViewModel);

                        _role.InsertRole(temprole);

                        var response = new HttpResponseMessage()
                        {
                            StatusCode = HttpStatusCode.OK
                        };

                        return(response);
                    }
                }
                else
                {
                    var response = new HttpResponseMessage()
                    {
                        StatusCode = HttpStatusCode.BadRequest
                    };

                    return(response);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }