Esempio n. 1
0
        public async Task <Field> AddField(string fieldValue)
        {
            var field = new Field()
            {
                Value = fieldValue
            };
            await fieldRepository.AddAsync(field);

            return(field);
        }
Esempio n. 2
0
        public async Task <Field> AddField(Field entity)
        {
            var data = new Field()
            {
                Value = entity.Value
            };

            await fieldRepository.AddAsync(data);

            return(data);
        }
Esempio n. 3
0
        public async Task <IActionResult> CreateField([FromBody] DTO.Field.Input.Field field)
        {
            var clubResult = await _fieldRepository.AddAsync(new Models.Field.Field()
            {
                Name            = field.Name,
                JSONCoordinates = JsonConvert.SerializeObject(field.FieldCoordinates),
                Address         = field.Address,
                Private         = field.Private,
                ClubId          = field.ClubId,
            });

            var result = AutoMapper.Mapper.Map <DTO.Field.Output.Field>(clubResult);

            return(Ok(result));
        }
Esempio n. 4
0
        public async Task AddAsync(FieldModel model)
        {
            await _fieldRepository.AddAsync(_mapper.Map <Field>(model));

            await _unitOfWork.CommitAsync();
        }