Ejemplo n.º 1
0
        public Record Add(MultimediaDto dto)
        {
            var hash = HashImageAndSaveInServer(dto.Base64);
            Map map  = CreateMap(hash, dto);

            return(_mapsService.Add(map));
        }
Ejemplo n.º 2
0
 public async Task <ActionResult <Record> > AddMultimedia(MultimediaDto dto)
 {
     return(await Task.Run(() =>
     {
         var output = _multimediaService.Add(dto);
         return new ActionResult <Record>(output);
     }));
 }
Ejemplo n.º 3
0
        private Map CreateMap(string hash, MultimediaDto dto)
        {
            Map map = new Map()
            {
                CreatedDate = DateTime.Now,
                Name        = dto.Name,
                Description = dto.Description,
                FloorId     = dto.ParentId,
                HashData    = hash,
                Extension   = "png"
            };

            return(map);
        }
Ejemplo n.º 4
0
        private MultimediaDto CreateDto(Map map, string base64)
        {
            MultimediaDto dto = new MultimediaDto()
            {
                MultimediaId = map.Id,
                ParentId     = map.FloorId,
                Base64       = base64,
                CreatedDate  = map.CreatedDate,
                Name         = map.Name,
                Description  = map.Description,
            };

            return(dto);
        }