Exemplo n.º 1
0
        public async Task <ActionResult <Contractor> > CreateOne([FromBody] Contractor newContractor)
        {
            try
            {
                Profile userInfo = await HttpContext.GetUserInfoAsync <Profile>();

                newContractor.CreatorId = userInfo.Id;
                newContractor.Creator   = userInfo;
                return(Ok(_cservice.CreateOne(newContractor)));
            }
            catch (System.Exception err)
            {
                return(BadRequest(err.Message));
            }
        }