public IEnumerable <Label> GetLabels(Topic topic, ImageLabel imageLabel) { #region validation if (topic == null) { throw new ArgumentNullException(nameof(topic)); } if (imageLabel == null) { throw new ArgumentNullException(nameof(imageLabel)); } #endregion IEnumerable <Label> labels = LabelRepository.GetLabels(topic, imageLabel).ToList(); if (labels.Any(o => string.IsNullOrEmpty(o.ObjectClassName))) { // load objectclasses only when labels includes where name of objectclass is not set List <ObjectClass> objectClasses = ObjectClassRepository.GetObjectClasses(topic).ToList(); foreach (Label label in labels) { label.ObjectClassName = objectClasses.GetObjectClass(label.ObjectClassId).Name; } } return(labels); }
/// <summary> /// obtains a list of tags /// </summary> /// <returns>returns the result to action</returns> public JsonResult GetTags() { LabelRepository objtag = new LabelRepository(SessionCustom); objtag.Entity.LanguageId = CurrentLanguage.LanguageId; return(this.Json(objtag.GetLabels(), JsonRequestBehavior.AllowGet)); }
public async Task <ActionResult <List <Label> > > GetLabels() { return(await lr.GetLabels(HttpContext.Items["UserID"].ToString())); }