public UpdateWorkOrderCommand Map(UpdateWorkOrderRequest request) { var id = new Guid(request.RouteId); var valuePairs = _jsonProvider.ToDictionary(request.BodyPatch); Optional <string> operant = valuePairs.GetOptional <string>("operant"); Optional <string> status = valuePairs.GetOptional <string>("status"); Optional <string> startedOn = valuePairs.GetOptional <string>("startedOn"); Optional <IEnumerable <HandledUnitDto> > handledUnits = valuePairs.GetOptional <IEnumerable <HandledUnitDto> >("handledUnits"); Optional <IEnumerable <RemarkDto> > remarks = valuePairs.GetOptional <IEnumerable <RemarkDto> >("remarks"); Optional <IEnumerable <PictureDto> > pictures = valuePairs.GetOptional <IEnumerable <PictureDto> >("pictures"); Optional <IEnumerable <InputDto> > inputs = valuePairs.GetOptional <IEnumerable <InputDto> >("inputs"); var version = ToVersion(request.HeaderIfMatch); var result = new UpdateWorkOrderCommand(id, operant, status, startedOn, handledUnits, remarks, pictures, inputs, version); return(result); }
public UpdateCommand Map(UpdateRequest request) { var id = new Guid(request.RouteId); var valuePairs = _jsonProvider.ToDictionary(request.BodyPatch); Optional <string> login = valuePairs.GetOptional("login"); Optional <string> password = valuePairs.GetOptional("password"); Optional <string> firstName = valuePairs.GetOptional("fIrstName"); Optional <string> lastName = valuePairs.GetOptional("lastName"); var version = ToVersion(request.HeaderIfMatch); var result = new UpdateCommand(id, login, password, firstName, lastName, version); return(result); }
public UpdateBusinessUnitCommand Map(UpdateBusinessUnitRequest request) { var id = new Guid(request.RouteId); var valuePairs = _jsonProvider.ToDictionary(request.BodyPatch); Optional <string> name = valuePairs.GetOptional("name"); var version = ToVersion(request.HeaderIfMatch); var result = new UpdateBusinessUnitCommand(id, name, version); return(result); }