Beispiel #1
0
        public IActionResult Post([FromBody] PersonValue value, [FromServices] IPersonBusiness personService, [FromServices] IMapper mapper)
        {
            var personDomain = mapper.Map <Person>(value);

            var personCreated = mapper.Map <PersonValue>(personService.Create(personDomain));

            return(Created("Post:Person", personCreated));
        }
Beispiel #2
0
 public IActionResult Post([FromBody] Person person)
 {
     if (person == null)
     {
         return(NotFound());
     }
     return(Ok(_personBusiness.Create(person)));
 }
Beispiel #3
0
 public IActionResult Post([FromBody] PersonVO person)
 {
     if (person == null)
     {
         return(BadRequest());
     }
     return(Ok(_personBusiness.Create(person)));
 }
 public IActionResult Post([FromBody] PersonVO personVO)
 {
     if (personVO == null)
     {
         return(NotFound());
     }
     return(new ObjectResult(_personBusiness.Create(personVO)));
 }
 public IActionResult Create([FromBody] Person item)
 {
     if (item == null)
     {
         return(BadRequest());
     }
     return(Ok(_personBusiness.Create(item)));
 }
 public IActionResult Post([FromBody] PersonVO person)
 {
     if (person.IsNull())
     {
         return(BadRequest());
     }
     return(new ObjectResult(_personBusiness.Create(person)));
 }
 public IActionResult Post([FromBody] Person person) //pega o Json que vem no corpo da request e converte para um objeto person
 {
     if (person == null)
     {
         return(BadRequest());
     }
     return(Ok(_IpersonBusiness.Create(person)));
 }
 public IActionResult Post([FromBody] PersonVO value)
 {
     if (value == null)
     {
         return(BadRequest());
     }
     return(new CreatedResult("teste", _personBusiness.Create(value)));
 }
Beispiel #9
0
 public IActionResult Post([FromBody] PersonVO PersonVO)
 {
     if (PersonVO == null)
     {
         return(BadRequest());
     }
     return(new ObjectResult(_personService.Create(PersonVO)));
 }
 public IActionResult Post([FromBody] Person value)
 {
     if (value == null)
     {
         return(BadRequest());
     }
     return(new ObjectResult(_personBusiness.Create(value)));
 }
 public IActionResult Post([FromBody] PersonVO person)
 {
     if (person == null)
     {
         return(NotFound());
     }
     return(new ObjectResult(_personService.Create(person)));
 }
 public ActionResult Post([FromBody] Person person)
 {
     if (person == null)
     {
         return(BadRequest());
     }
     return(new ObjectResult(_personBusiness.Create(person)));
 }
Beispiel #13
0
        //[TypeFilter(typeof(HyperMediaFilter))]    //não funcionou...
        public IActionResult Post([FromBody] PersonVO person)
        {
            if (person == null)
            {
                return(BadRequest("Invalid person"));
            }

            return(new CreatedResult("", _personBusiness.Create(person)));
        }
Beispiel #14
0
        public IActionResult Post([FromBody] Person person)
        {
            if (person == null)
            {
                return(BadRequest());
            }

            return(new OkObjectResult(_personService.Create(person)));
        }
Beispiel #15
0
        public IActionResult Post([FromBody] Person person)
        {
            if (person == null)
            {
                return(BadRequest("Deu ruim aqui fera"));
            }

            return(Ok(_personBusiness.Create(person)));
        }
Beispiel #16
0
        public IActionResult Post([FromBody] PersonDTO person)
        {
            // descobrir quem esta fazendo a solicitação pelo token
            var userName = User.Identity.Name;

            if (person == null)
            {
                return(NotFound());
            }
            return(new ObjectResult(_personBusiness.Create(person)));
        }
Beispiel #17
0
 public IActionResult Post([FromBody] PersonVO person)
 {
     if (person != null)
     {
         return(Ok(_personRepository.Create(person)));
     }
     else
     {
         return(BadRequest("Nullable object"));
     }
 }
        public IActionResult Post([FromBody] PersonVO person)
        {
            // Obtem o id do usuario a partir disso basta fazermos log, auditoria etc
            var userName = User.Identity.Name;

            if (person == null)
            {
                return(BadRequest());
            }
            return(new ObjectResult(_personBusiness.Create(person)));
        }
 public IActionResult Post([FromBody] PersonInVO model)
 {
     try
     {
         var _entity = model.CreateEntity();
         _personBusiness.Create(ref _entity);
         return(Accepted(_entity));
     }
     catch (Exception ex)
     {
         return(this.ReturnActionResult(ex));
     }
 }
 public IActionResult Post([FromBody] Usuario person)
 {
     if (person == null)
     {
         return(BadRequest());
     }
     if (_personBusiness.Create(person))
     {
         return(Ok(person));
     }
     else
     {
         return(BadRequest());
     }
 }
Beispiel #21
0
        public async Task <IActionResult> Create([FromBody] Person model)
        {
            model             = new Person();
            model.DisplayName = "Lind Diệu";
            model.WorkAs      = "HR";
            model.Rate        = 7;

            model.Experience      = 2;
            model.JobFunctionTags = new List <JobFunction>()
            {
                new JobFunction()
                {
                    Code = "hr", Display = "HR"
                }
            };
            Person person = await m_PersonBusiness.Create(model);

            return(Json(person));
        }
 public IActionResult Post([FromBody]Person person)
 {
     if (person == null) return BadRequest();
     return new ObjectResult(_personService.Create(person));
 }
Beispiel #23
0
 public static void Run(this IPersonBusiness iPersonBusiness)
 {
     iPersonBusiness.Create(new Model.Person());
 }
Beispiel #24
0
 public IActionResult Create([FromBody] Person person)
 {
     return(Ok(_personBusiness.Create(person)));
 }
 public ActionResult Post([FromBody] Person person)
 {
     return(new ObjectResult(_personBusiness.Create(person)));
 }
 public Person Create(Person person)
 {
     return(_repository.Create(person));
 }
Beispiel #27
0
 public IActionResult Post([FromBody] PersonVO person)
 {
     return(person == null
         ? (IActionResult)BadRequest()
         : Ok(new ObjectResult(_personBusiness.Create(person)).Value));
 }
        public IActionResult Post([FromBody] Person person)
        {
            _personBusiness.Create(person);

            return(Ok(person));
        }