public async Task <IActionResult> Create([FromBody] PlanTypeModel item)
        {
            if (item.PlanTypeId == 0)
            {
                await _repository.Add(item);

                return(CreatedAtRoute("GetPlanType", new { Controller = "PlanType", id = item.PlanTypeId }, item));
            }
            else
            {
                if (item.PlanTypeId > 0)
                {
                    await _repository.Update(item);
                }
            }
            return(BadRequest());
        }
Ejemplo n.º 2
0
 public bool Add()
 {
     return(m_planTypeRepository.Add(this));
 }