public async Task <JsonResult> GetByID(string id, string api) { try { var data = IS_ItemService.GetByID(Guid.Parse(id), Guid.Parse(api)); return(Success(IS_ItemVM.MToVM(data))); } catch { return(Failed(MessageUtility.ServerError())); } }
public static IS_ItemVM SetSubData(IS_Item data, Guid aid) { var model = IS_ItemVM.MToVM(data); model.DateTimeStorage = DateTimeStorageVM.MToVM(DateTimeStorageService.GetByID(data.DateTimeStorageID)); model.ItemCategory = StatusTypesReferencesVM.MToVM(StatusTypesReferencesService.GetByID(data.ItemCategoryID)); model.ItemColors = IS_ItemColorService.SetSubDatas(IS_ItemColorService.GetByOwnerID(data.ID, aid)); model.Images = ImageLinkStorageVM.MsToVMs(ImageLinkStorageService.GetByOIDAPI(data.ID, aid)); model.Condition = StatusTypesReferencesVM.MToVM(StatusTypesReferencesService.GetByID(data.ConditionID)); return(model); }