public AdminLookupItemValueModel(AdminLookupItemValue entity) { Id = entity.Id; CanonicalName = entity.CanonicalName; DisplayName = entity.DisplayName; Abbreviation = entity.Abbreviation; }
public async Task <AdminLookupItemValueModel> GetItem(string name, string id) { AdminLookupItemValue entity = await _adminLookupItemManager.GetItemAsync(name, id); var model = new AdminLookupItemValueModel(entity); return(model); }
public async Task <AdminLookupItemValue> GetItemAsync(string name, string id) { AdminLookupItemValue item = null; var group = await GetItemAsync(name); if (group != null) { item = await GetItem(group.Values, id); } return(item); }
private async Task <IEnumerable <AdminLookupItemValue> > ConvertModelToEntity(List <AdminLookupItemValueModel> model) { List <AdminLookupItemValue> lookupItemsEntity = new List <AdminLookupItemValue>(); foreach (AdminLookupItemValueModel lookupItemValueModel in model) { AdminLookupItemValue lookupItemEntity = new AdminLookupItemValue() { Id = Guid.NewGuid().ToString(), CanonicalName = lookupItemValueModel.CanonicalName, Abbreviation = lookupItemValueModel.Abbreviation, }; lookupItemsEntity.Add(lookupItemEntity); } return(lookupItemsEntity); }