예제 #1
0
        private Image GetImageModel(IFormFile image)
        {
            string fn  = Path.GetFileNameWithoutExtension(image.FileName);
            Image  img = new Image()
            {
                IId          = ImageWriter.GetImageHash(image),
                UId          = HttpContext.User.FindFirstValue("http://schemas.microsoft.com/identity/claims/objectidentifier"),
                ImageName    = fn,
                Size         = (Int32)image.Length,
                UploadedDate = DateTime.Now,
                Type         = _repo.GetFileExtension(image),
                Trashed      = false,
                Submitted    = false,
                UploadedBy   = HttpContext.User.FindFirstValue("http://schemas.microsoft.com/identity/claims/objectidentifier")
            };

            return(img);
        }