public async Task <bool> InsertAsync(Genre entity) { await _context.AddAsync(entity); var affectedRows = await _context.SaveChangesAsync(); return(affectedRows > 0); }
public async Task <bool> InsertAsync(MovieModel entity) { var movieDb = entity.ToEntity(); await _context.AddAsync(movieDb); int affectedRows = await _context.SaveChangesAsync(); return(affectedRows > 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); }