コード例 #1
0
		public static bool DeleteInspectionItemImage(
			ApplicationDbContext ctx,
			InspectionImage image)
		{
			ctx.InspectionImages.Remove(image);
			return TrySave(ctx);
		}
コード例 #2
0
		public static bool UpdateInspectionImageVisibility(
			ApplicationDbContext ctx,
			InspectionImage image,
			bool isVisibleToCustomer)
		{
			image.IsVisibleToCustomer = isVisibleToCustomer;

			return TrySave(ctx);
		}
コード例 #3
0
		public static bool AddInspectionItemImage(
			ApplicationDbContext ctx,
			InspectionItem inspectionItem,
			Image image)
		{
			var inspectionImage = new InspectionImage
			{
				Id = image.Id,
				Title = image.Title,
				CreatedDate = image.CreatedDate,
				ImageUrl = image.ImageUrl,
				InspectionItem = inspectionItem
			};

			inspectionItem.InspectionImages.Add(inspectionImage);
			ctx.InspectionImages.Add(inspectionImage);

			return TrySave(ctx);
		}