コード例 #1
0
        public async Task <IActionResult> Create(int patrolId, string name, int?copyFromPlanId)
        {
            if (User.RoleInPatrol(patrolId).CanMaintainPlans())
            {
                var plan = await _planService.CreatePlan(name, patrolId, copyFromPlanId);

                return(Ok(plan));
            }
            else
            {
                return(Forbid());
            }
        }
コード例 #2
0
 /// <summary>
 /// Creates new plan in databse
 /// </summary>
 /// <param name="plan">Object to be saved to database</param>
 public Guid CreatePlan(Plan plan)
 {
     return(_planService.CreatePlan(plan));
 }