예제 #1
0
        public async Task <IActionResult> Create([FromBody] PlanResource planResource)
        {
            if (planResource == null)
            {
                planResource = new PlanResource();
            }

            var plan   = _mapper.Map <PlanResource, Plan>(planResource);
            var result = await _plansService.AddAsync(plan);

            if (!result.Success)
            {
                return(BadRequest(result));
            }

            return(Ok(result));
        }