public CameraResult(CameraDTO config) { this.Config = config; this.DownloadedPhotos = new List <PhotoDTO>(); this.DownloadedVideos = new List <VideoDTO>(); this.DeletedFiles = new List <DeletedFileDTO>(); }
private Camera GetCameraFromDTO(CameraDTO camDTO) { Camera cam = Service.CreateCamera(); CameraDTO.GetAttributesFromDTO(camDTO, cam); if (camDTO.Floor != null) { cam.Floor = FloorService.GetFloor((Guid)camDTO.Floor); } else { cam.Floor = null; } //if (camDTO.People != null) // { // foreach (Guid personGuid in camDTO.People) cam.People.Add(PersonService.GetPerson(personGuid)); // } //Seems like we need a person type service too. if (cam.PersonTypes == null) { cam.PersonTypes = new List <PersonType>(); } return(cam); }
public Camera GetCamera(CameraDTO cameraConf) { var cam = new Camera { Alias = cameraConf.Alias, DestinationFolder = cameraConf.DestinationFolder, IpAddress = cameraConf.IpAddress, PortNumber = cameraConf.PortNumber, UserName = cameraConf.UserName, }; return(cam); }
// PUT: api/Cameras //The parameter is completely optional as we do have the Guid inside the camera DTO. public void Put([FromBody] CameraDTO camDTO) { Camera cam = GetCameraFromDTO(camDTO); Service.Update(cam); }
// POST: api/Cameras public void Post([FromBody] CameraDTO camDTO) { Camera cam = GetCameraFromDTO(camDTO); Service.AddCamera(cam); }