public async Task <bool> AddBiography(string id, string biography)
        {
            var user = await context.Users.FindAsync(id);

            if (user != null)
            {
                user.Biography = biography;
                await context.SaveChangesAsync();

                return(true);
            }

            return(false);
        }
        public async Task <Photo> Add(string id, PhotoResource photoResource)
        {
            //var user = repository.Get(id);

            var user = await context.Users.FindAsync(id);

            if (user == null)
            {
                return(null);
            }
            if (user != null)
            {
                var uploadsFolder = Path.Combine(hostingEnvironment.WebRootPath, "images");
                if (!Directory.Exists(uploadsFolder))
                {
                    Directory.CreateDirectory(uploadsFolder);
                }
                var uniqueFileName = Guid.NewGuid().ToString() + Path.GetExtension(photoResource.PhotoPath.FileName);
                var filePath       = Path.Combine(uploadsFolder, uniqueFileName);
                photoResource.PhotoPath.CopyTo(new FileStream(filePath, FileMode.Create));
                var file = new Photo {
                    PhotoPath = filePath
                };
                //await unitOfWork.CompleteAsync();
                var photo = mapper.Map <PhotoResource, Photo>(photoResource);
                photo.PhotoPath = filePath;

                user.Photo = photo;
                await context.SaveChangesAsync();

                return(photo);
            }

            return(null);
        }