File tree Expand file tree Collapse file tree 5 files changed +24
-27
lines changed
src/DynamicAuthorization.Mvc.Ui/Views Expand file tree Collapse file tree 5 files changed +24
-27
lines changed Original file line number Diff line number Diff line change 1- @using DynamicAuthorization .Mvc .Ui
2- @using DynamicAuthorization .Mvc .Ui .ViewModels
3- @using Microsoft .AspNetCore .Identity
1+ @using DynamicAuthorization .Mvc .Ui .ViewModels
42@using DynamicAuthorization .Mvc .Core
53@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
64@model RoleViewModel
Original file line number Diff line number Diff line change 1- @using DynamicAuthorization .Mvc .Ui
2- @using DynamicAuthorization .Mvc .Ui .ViewModels
3- @using Microsoft .AspNetCore .Identity
1+ @using DynamicAuthorization .Mvc .Ui .ViewModels
42@using DynamicAuthorization .Mvc .Core
53@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
64@model RoleViewModel
Original file line number Diff line number Diff line change 1- @using DynamicAuthorization .Mvc .Ui
2- @using DynamicAuthorization .Mvc .Ui .ViewModels
3- @using Microsoft .AspNetCore .Identity
4- @using DynamicAuthorization .Mvc .Core
1+ @using Microsoft .AspNetCore .Identity
52@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
63@model IEnumerable <IdentityRole >
74
Original file line number Diff line number Diff line change 1- @using DynamicAuthorization .Mvc .Ui
2- @using DynamicAuthorization .Mvc .Ui .ViewModels
1+ @using DynamicAuthorization .Mvc .Ui .ViewModels
32@using Microsoft .AspNetCore .Identity
4- @using DynamicAuthorization .Mvc .Core
53@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
64@model UserRoleViewModel
75@{
Original file line number Diff line number Diff line change 1- @using DynamicAuthorization .Mvc .Ui
2- @using DynamicAuthorization .Mvc .Ui .ViewModels
3- @using Microsoft .AspNetCore .Identity
4- @using DynamicAuthorization .Mvc .Core
1+ @using DynamicAuthorization .Mvc .Ui .ViewModels
52@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
63@model IEnumerable <UserRoleViewModel >
74@{
2421 <tbody >
2522 @foreach ( var user in Model )
2623 {
27- <tr >
28- <td >@Html.DisplayFor(m => user .UserName )</td >
29- <td >
30- @foreach (var role in user .Roles )
24+ <tr >
25+ <td >@Html.DisplayFor(m => user .UserName )</td >
26+ <td >
27+ @for (var i = 0 ; i < user .Roles . Count (); i ++ )
3128 {
32- <span >@Html.DisplayFor(m => role ) | </span >
29+ if (i < user .Roles .Count () - 1 )
30+ {
31+ var element = user .Roles .ElementAt (i );
32+ < span > @Html .DisplayFor (_ => element ) | < / span >
33+ }
34+ else
35+ {
36+ var element = user .Roles .ElementAt (i );
37+ <span >@Html.DisplayFor(_ => element )</span >
38+ }
3339 }
34- </td >
35- <td >
36- <a asp-action =" Edit" asp-route-id =" @user.UserId" >Edit </a >
37- </td >
38- </tr >
40+ </td >
41+ <td >
42+ <a asp-action =" Edit" asp-route-id =" @user.UserId" >Edit </a >
43+ </td >
44+ </tr >
3945 }
4046 </tbody >
4147 </table >
You can’t perform that action at this time.
0 commit comments