示例#1
0
 public ResultDTO Post([FromBody] RoleEntity roleEntity)
 {
     try
     {
         return(_roleServices.CreateRole(roleEntity));
     }
     catch (Exception ex)
     {
         throw new ApiDataException(1000, "Role Not Found", HttpStatusCode.NotFound);
     }
 }
示例#2
0
        public IHttpActionResult Create([FromBody] InputCreateRole input)
        {
            var result = _roleServices.CreateRole(input);

            return(Ok(result));
        }
示例#3
0
 public async Task <IActionResult> PostRole(Role role)
 {
     return(Ok(await roleServices.CreateRole(role)));
 }