Example #1
0
        public PatientStatusDTO CreatePatientStatus(PatientStatusCreateDTO info)
        {
            StoreContext db = new StoreContext();

            if (!string.IsNullOrEmpty(info.Name) || info.Name != "string")
            {
                PatientStatus patientStatus = mapper.Map <PatientStatus>(info);

                db.PatientStatus.Add(patientStatus);
                db.SaveChanges();

                PatientStatusDTO response = mapper.Map <PatientStatusDTO>(patientStatus);

                return(response);
            }

            else
            {
                return(null);
            }
        }
        public IActionResult CreatePatientStatus([FromBody] PatientStatusCreateDTO info)
        {
            PatientStatusDTO response = repository.CreatePatientStatus(info);

            return(new ObjectResult(response));
        }