コード例 #1
0
        public Task <IActionResult> DeleteTeamHolder(TeamHolderDeleteRequest request)
        {
            //Recupero l'elemento dal business layer
            var entity = BasicLayer.GetTeamHolderByTeamAndShooterId(request.TeamId, request.ShooterId);

            //Se l'utente non hai i permessi non posso rimuovere entità con userId nullo
            if (entity == null)
            {
                return(Task.FromResult <IActionResult>(NotFound()));
            }
            //Invocazione del service layer
            var validations = BasicLayer.DeleteTeamHolder(entity);

            if (validations.Count > 0)
            {
                return(BadRequestTask(validations));
            }

            //Return contract
            return(Reply(new OkResponse {
                Status = true
            }));
        }