public async Task <IActionResult> CreateMatch(MatchCreateRequest request) { //Creazione modello richiesto da admin var model = new Match { Name = request.Name, MatchDateTimeStart = request.MatchDateTimeStart, MatchDateTimeEnd = request.MatchDateTimeEnd, AssociationId = request.AssociationId, PlaceId = request.PlaceId, OpenMatch = request.OpenMatch, UnifyClassifications = request.UnifyClassifications, Cost = request.Cost, PaymentDetails = request.PaymentDetails }; //Invocazione del service layer var validations = await BasicLayer.CreateMatch(model, PlatformUtils.GetIdentityUserId(User)); if (validations.Count > 0) { return(BadRequest(validations)); } var association = BasicLayer.GetAssociation(model.AssociationId); var place = BasicLayer.GetPlace(model.PlaceId); //Return contract return(Ok(ContractUtils.GenerateContract(model, association, place))); }