public async Task <IActionResult> GetCoordinateList(int coordinateListId)
        {
            Squares.Models.Coordinates.CoordinateList createdCoordinateList = await _coordinateService.GetCoordinateList(coordinateListId).ConfigureAwait(false);

            CoordinateList apiCoordinateList = Mapper.Map(createdCoordinateList);

            return(Ok(apiCoordinateList));
        }
Ejemplo n.º 2
0
 public static CoordinateList Map(Squares.Models.Coordinates.CoordinateList coordinateList)
 {
     return(new CoordinateList
     {
         Id = coordinateList.Id,
         Coordinates = coordinateList.Coordinates.Select(Map).ToList()
     });
 }
        public async Task <IActionResult> CreateCoordinateList([FromBody] List <CoordinateCreateRequest> coordinates)
        {
            List <Squares.Models.Coordinates.Coordinate> mappedCoordinates = coordinates.Select(Mapper.Map).ToList();

            Squares.Models.Coordinates.CoordinateList createdCoordinateList = await _coordinateService.CreateCoordinateList(mappedCoordinates).ConfigureAwait(false);

            CoordinateList apiCoordinateList = Mapper.Map(createdCoordinateList);

            return(CreatedAtRoute(RouteNames.GetCoordinateListById, new { coordinateListId = apiCoordinateList.Id }, apiCoordinateList));
        }