Esempio n. 1
0
 public async Task <IHttpActionResult> Create(MatchInputDto matchInput)
 {
     return(await TryCatchAsync(async() =>
     {
         var match = await _matchesServices.Create(matchInput);
         return Ok(match);
     }));
 }
        public async Task <MatchOutputDto> Create(MatchInputDto matchInput)
        {
            var match = MappingConfig.Mapper().Map <Match>(matchInput);

            match = await _matchesRepository.CreateAsync(match);

            return(MappingConfig.Mapper().Map <MatchOutputDto>(match));
        }
Esempio n. 3
0
        private async void CreateCommandExecute()
        {
            await TryCatchAsync(async() =>
            {
                var match = new MatchInputDto
                {
                    CreatedBy      = Settings.EmployeeId,
                    Date           = new DateTime(Model.Date.Year, Model.Date.Month, Model.Date.Day, Model.Hour.Hours, Model.Hour.Minutes, Model.Hour.Seconds),
                    Place          = Model.Place,
                    MinimumPlayers = Model.MinimumPlayers,
                    Value          = Model.Value,
                    WithBarbecue   = Model.WithBarbecue,
                    BarbecueValue  = Model.BarbecueValue,
                    CreateDate     = DateTime.Now
                };

                await ClientApi.Matches.Create(match);

                await NavigateTo(Routes.Matches(true));
            });
        }
 public async Task Delete(MatchInputDto matchInput)
 {
     var match = MappingConfig.Mapper().Map <Match>(matchInput);
     await _matchesRepository.DeleteAsync(match);
 }