ahmedaziz
Well-known member
- Joined
- Feb 22, 2023
- Messages
- 55
- Programming Experience
- 1-3
I work on EF core 7 blazor . I face issue I can't call Details model from application page to get all Data for details model .
meaning I need to display details data as list on application page where Header Id = 1 on action GetAllDetails.
so when call Application/GetAllDetails I will get all Details contain ID AND DetailsName from model details where Header Id=1
details models
meaning I need to display details data as list on application page where Header Id = 1 on action GetAllDetails.
so when call Application/GetAllDetails I will get all Details contain ID AND DetailsName from model details where Header Id=1
details models
Details model:
public class Details
{
public int ID { get; set; }
public string DetailsName { get; set; }
public int HeaderId { get; set; }
}
application model:
public class Applications
{
[Key]
public int ApplicationID { get; set; }
public string Section { get; set;}
public string ApplicationName { get; set; }
}
controller application:
[Route("api/[controller]")]
[ApiController]
public class ApplicationController : Controller
{
private readonly IapplicationService _IapplicationService;
public ApplicationController(IapplicationService iapplicationService)
{
_IapplicationService = iapplicationService;
}
[HttpGet]
public IActionResult GetAllDetails()
{
//How to get all details
return Ok();
}