/// <summary> /// Validate the object. /// </summary> /// <exception cref="ValidationException"> /// Thrown if validation fails /// </exception> public virtual void Validate() { if (Type == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Type"); } if (ContainerResource != null) { ContainerResource.Validate(); } if (External != null) { External.Validate(); } if (ObjectProperty != null) { ObjectProperty.Validate(); } if (Pods != null) { Pods.Validate(); } if (Resource != null) { Resource.Validate(); } }
public async Task <ActionResult <ContainerResource> > GetPackedContainer( Guid shipmentIdentity, Guid containerIdentity, [FromServices] ShipmentQuery shipmentQuery) { ContainerResource container = await shipmentQuery .GetPackedContainerAsync(shipmentIdentity, containerIdentity); if (container is null) { return(NotFound()); } return(container); }
public async Task <ActionResult <ContainerResource> > GetLoadedContainer( Guid supplierIdentity, Guid containerIdentity, [FromServices] SupplierQuery supplierQuery) { ContainerResource container = await supplierQuery .GetLoadedContainerAsync(supplierIdentity, containerIdentity); if (container is null) { return(NotFound()); } return(container); }