public async Task <IActionResult> Post([FromRoute] Guid bioId, [FromBody] TileCreateModel model) { var dbModel = model.ToModel(); dbModel.Id = Guid.NewGuid(); dbModel.BioLandingId = bioId; return(Ok((await repo.Insert(dbModel)).ToViewModel())); }
public static Tile ToModel(this TileCreateModel createModel) { return(new Tile { Title = createModel.Title, Color = createModel.Color, Uri = createModel.Uri }); }