public async Task <Field> AddField(string fieldValue) { var field = new Field() { Value = fieldValue }; await fieldRepository.AddAsync(field); return(field); }
public async Task <Field> AddField(Field entity) { var data = new Field() { Value = entity.Value }; await fieldRepository.AddAsync(data); return(data); }
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)); }
public async Task AddAsync(FieldModel model) { await _fieldRepository.AddAsync(_mapper.Map <Field>(model)); await _unitOfWork.CommitAsync(); }