@using System.Reflection @using System.ComponentModel.DataAnnotations @using Shared.DTOs @typeparam T
@{ PropertyInfo[] properties = typeof(T).GetProperties(); foreach (var item in properties) { if (item.GetCustomAttributes(typeof(DisplayAttribute), false).Length > 0) { } } } @{ foreach (var item in ModelinComponent) { @{ properties = item.GetType().GetProperties(); int id = 0; foreach (PropertyInfo property in properties) { if (property.Name.ToLower()=="id") id =Convert.ToInt32(property.GetValue(item, null)); if (property.CustomAttributes.Any(w => w.AttributeType.Name == "DisplayAttribute")) { } } if (id>0) { } else { } } } }
@item.CustomAttributes.Where(w => w.AttributeType.Name == "DisplayAttribute").Select(s => s.NamedArguments.Where(w => w.MemberName == "Name").Select(ss => ss.TypedValue.Value).First()).First().ToString() عملیات
@property.GetValue(item, null)
@code { [Parameter] public List ModelinComponent { get; set; } = new List(); [Parameter] public EventCallback OnMultipleOfThree { get; set; } }