public static AgentVersion ToDomainObjectFromDto(AgentVersionDto dto) { AgentVersion result = new AgentVersion(dto.VersionString); result.DownloadLink = dto.DownloadLink; result.Id = dto.Id; result.ReleasedDate = dto.ReleasedDate; return(result); }
public static AgentVersionDto FromDomainObjectToDto(AgentVersion source) { AgentVersionDto target = new AgentVersionDto(); target.DownloadLink = source.DownloadLink; target.Id = source.Id; target.ReleasedDate = source.ReleasedDate; target.VersionString = source.VersionString; return(target); }
public static AvailableAgentVersion FromDtoToDomainObject(AgentVersionDto source) { AvailableAgentVersion target = new AvailableAgentVersion(); target.DownloadLink = source.DownloadLink; target.Id = source.Id; target.ReleasedDate = source.ReleasedDate; target.VersionString = source.VersionString; return(target); }
private void GetLastVersion(object w, DoWorkEventArgs e) { Thread.Sleep(10000); try { using (VtsWebServiceClient service = new VtsWebServiceClient()) { AgentVersionDto lastAgentVersionDto = service.GetLastAgentVersion(); AgentVersion lastVersion = AgentVersionAssembler. ToDomainObjectFromDto(lastAgentVersionDto); e.Result = lastVersion; } } catch (Exception ex) { if (errorCallback != null) { errorCallback.Invoke(ex, ex.Message); } } }