File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed
developments/BlazorComponent/BlazorComponent/Components/Pages/Medicos Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ @page " /medicos"
2+
3+ @rendermode InteractiveServer
4+ @inject IMedicoRepository repository
5+ @inject NavigationManager navigation
6+
7+ <CustomHeader >
8+ LISTAGEM DE MÉDICOS
9+ </CustomHeader >
10+
11+ <button class =" btn btn-primary" @onclick =" NovoMedico" >NOVO MÉDICO</button >
12+
13+ <table class =" table table-striped" >
14+ <thead >
15+ <tr >
16+ <th >ID</th >
17+ <th >NOME</th >
18+ <th >CRM</th >
19+ <th >#</th >
20+ </tr >
21+ </thead >
22+ <tbody >
23+ <MedicoTemplateList Medicos =" @Medicos" DeleteCallback =" Delete" />
24+ </tbody >
25+ </table >
26+
27+ @code {
28+ public List <Medico >? Medicos ;
29+
30+ protected override async Task OnInitializedAsync ()
31+ {
32+ Medicos = await repository .GetAllAsync ();
33+ }
34+
35+ public void Delete (Medico medico )
36+ {
37+ Medicos ? .Remove (medico );
38+ }
39+
40+ public void NovoMedico ()
41+ {
42+ navigation .NavigateTo (" /medicos/create" );
43+ }
44+ }
You can’t perform that action at this time.
0 commit comments