public async Task <JsonResult> GetByID(string id, string iid) { try { var data = IS_ItemImageService.GetByID(Guid.Parse(id), Guid.Parse(iid)); return(Success(IS_ItemImagesVM.MToVM(data))); } catch { return(Failed(MessageUtility.ServerError())); } }
public static bool Insert(Guid id, string source, Guid itemID) { try { using (var context = new GeopersonContext()) { var model = IS_ItemImagesVM.Set(id, source, itemID); context.IS_ItemImagesDB.Add(model); context.SaveChanges(); return(true); } } catch { return(false); } }