public static IEnumerable <IGoodIdentificationMvoStateDto> ToGoodIdentificationMvoStateDtoCollection(IEnumerable <ProductGoodIdentificationId> ids) { var states = new List <IGoodIdentificationMvoStateDto>(); foreach (var id in ids) { var dto = new GoodIdentificationMvoStateDtoWrapper(); dto.ProductGoodIdentificationId = id; states.Add(dto); } return(states); }
public IGoodIdentificationMvoStateDto Get(string id, string fields = null) { try { var idObj = GoodIdentificationMvosControllerUtils.ParseIdString(id); var state = _goodIdentificationMvoApplicationService.Get(idObj); if (state == null) { return(null); } var stateDto = new GoodIdentificationMvoStateDtoWrapper(state); if (String.IsNullOrWhiteSpace(fields)) { stateDto.AllFieldsReturned = true; } else { stateDto.ReturnedFieldsString = fields; } return(stateDto); } catch (Exception ex) { var response = GoodIdentificationMvosControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public static CreateGoodIdentificationMvoDto ToCreateGoodIdentificationMvo(this GoodIdentificationMvoStateDtoWrapper state) { return(state.ToCreateGoodIdentificationMvo <CreateGoodIdentificationMvoDto>()); }
public static MergePatchGoodIdentificationMvoDto ToMergePatchGoodIdentificationMvo(this GoodIdentificationMvoStateDtoWrapper state) { return(state.ToMergePatchGoodIdentificationMvo <MergePatchGoodIdentificationMvoDto>()); }
public static IGoodIdentificationMvoCommand ToCreateOrMergePatchGoodIdentificationMvo(this GoodIdentificationMvoStateDtoWrapper state) { return(state.ToCreateOrMergePatchGoodIdentificationMvo <CreateGoodIdentificationMvoDto, MergePatchGoodIdentificationMvoDto>()); }