public static UnderTrackGroup MapToDbModel(this UnderTrackGroupDto underTrackGroupDto) { var underTrackGroup = new UnderTrackGroup { CenterId = underTrackGroupDto.CenterId, Name = underTrackGroupDto.Name, Description = underTrackGroupDto.Description, }; if (underTrackGroupDto.Id.HasValue) { underTrackGroup.Id = underTrackGroupDto.Id.Value; } return(underTrackGroup); }
public IActionResult AddGroup(UnderTrackGroupDto underTrackGroupDto) { _underTrackService.AddGroup(underTrackGroupDto); return(Ok("ok")); }
public void AddGroup(UnderTrackGroupDto underTrackGroupDto) { _underTrackRepository.AddGroup(underTrackGroupDto.MapToDbModel()); }