@using Entities.Contracts
@using Entities.DTO
@using TechHelper.Client.Services
<h3>StudentsView</h3>


@foreach(var cs in ClassStudents)
{
	<MudText> @cs.DisplayName </MudText>
}


@code {
	[CascadingParameter]
	private Task<AuthenticationState> authenticationStateTask { get; set; }

	private List<StudentDto> ClassStudents { get; set; } = new List<StudentDto>();

	[Inject]
	public IClassServices ClassServices { get; set; }

	protected override async Task OnInitializedAsync()
	{
		var result = await ClassServices.GetClassStudents();
		ClassStudents = result.Result as List<StudentDto> ?? new List<StudentDto>();
		StateHasChanged();
	}
}
