using BlazorSyncfusionCrm.Server.Data; using BlazorSyncfusionCrm.Shared; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.ChangeTracking; namespace BlazorSyncfusionCrm.Server.Controllers { [Route("api/[controller]")] [ApiController] public class NotesController : ControllerBase { private readonly DataContext _context; public NotesController(DataContext context) { _context = context; } [HttpGet] public async Task>> GetAllNotes() { return await _context.Notes .Include(n => n.Contact) .OrderByDescending(n => n.DateCreated) .ToListAsync(); } } }