예제 #1
0
        public async Task <bool> InsertAsync(Genre entity)
        {
            await _context.AddAsync(entity);

            var affectedRows = await _context.SaveChangesAsync();

            return(affectedRows > 0);
        }
예제 #2
0
        public async Task <bool> InsertAsync(MovieModel entity)
        {
            var movieDb = entity.ToEntity();
            await _context.AddAsync(movieDb);

            int affectedRows = await _context.SaveChangesAsync();

            return(affectedRows > 0);
        }
예제 #3
0
        public async Task <bool> InsertAsync(string path)
        {
            var imageArray = File.ReadAllBytes(path);
            var fileData   = new FileData
            {
                Data = imageArray
            };
            await _context.AddAsync(fileData);

            var affectedRows = await _context.SaveChangesAsync();

            return(affectedRows > 0);
        }