| 1234567891011121314151617181920212223242526272829303132333435363738 | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using UnivateProperties_API.Model.Users;
using UnivateProperties_API.Repository;
namespace UnivateProperties_API.Controllers.Users
{
    [Route("api/[controller]")]
    [ApiController]
    public class NonRegIndividualController : ControllerBase
    {
        private readonly IRepository<NonRegIndividual> _Repo;
        public NonRegIndividualController(IRepository<NonRegIndividual> rp)
        {
            _Repo = rp;
        }
        [HttpGet]
        public IActionResult Get()
        {
            var roles = _Repo.GetAll();
            return new OkObjectResult(roles);
        }
        [HttpGet("{id}")]
        public IActionResult Get(int id)
        {
            return new OkObjectResult(_Repo.Get(x => x.WeekId == id));
        }
       
    }
}
 |