public async Task <IActionResult> CreateShooterAssociationInfo(ShooterAssociationInfoCreateRequest request) { var(validations, shooter, association) = CheckRequest(request.ShooterId, request.AssociationId, request.Categories); if (validations.Count > 0) { return(BadRequest(validations)); } var entity = new ShooterAssociationInfo { ShooterId = request.ShooterId, AssociationId = request.AssociationId, CardNumber = request.CardNumber, SafetyOfficier = request.SafetyOfficier, RegistrationDate = request.RegistrationDate, Categories = request.Categories }; //Invocazione del service layer validations = await BasicLayer.CreateShooterAssociationInfo(entity, PlatformUtils.GetIdentityUserId(User)); if (validations.Count > 0) { return(BadRequest(validations)); } //Return contract return(Ok(ContractUtils.GenerateContract(entity, association, shooter))); }