Skip to content

Instantly share code, notes, and snippets.

View cbdribamar's full-sized avatar

Daniel Ribamar Martins cbdribamar

  • Carlsberg
  • Oeiras
View GitHub Profile
@cbdribamar
cbdribamar / repository.cs
Created February 11, 2026 15:33
Interview | Q3
public class OrdersApiController : UmbracoApiController
{
private readonly IUmbracoDatabase _database;
public OrdersApiController(IUmbracoDatabase database)
{
_database = database;
}
[HttpPost]
@cbdribamar
cbdribamar / controller.cs
Created February 11, 2026 15:28
Interview | Q2
public class ProductsApiController : UmbracoApiController
{
[HttpGet]
public IActionResult GetProducts()
{
var products = Umbraco.ContentAtRoot()
.First()
.Descendants()
.Where(x => x.ContentType.Alias == "product");
@cbdribamar
cbdribamar / controller.cs
Created February 11, 2026 12:04
Interview | Q1
[ApiController]
[Route("api/[controller]")]
public class ProductsController : ControllerBase
{
[HttpGet("{id}")]
public IActionResult GetProduct(int id)
{
var contentQuery = new PublishedContentQuery();
var product = contentQuery.Content(id);