public async Task <ActionResult <Torrentdetails> > getTorrent([FromQuery][Required] string id)
        {
            Torrentdetails torrent = await torrentServices.getTorrentAsync(id);

            if (torrent == null)
            {
                return(NotFound());
            }
            return(torrent);
        }
        public async Task <bool> createTorrentAsync(Torrentdetails torrent)
        {
            try
            {
                await torrentCollection.InsertOneAsync(torrent);

                return(true);
            }
            catch (MongoWriteException e)
            {
                return(false);
            }
        }
        public async Task <ActionResult <bool> > getRemoveWithTorrent([FromBody] Torrentdetails torrent)
        {
            await torrentServices.RemoveAsync(torrent);

            return(true);
        }
        public async Task <ActionResult <bool> > getUpdateTorrent(string id, [FromBody] Torrentdetails torrent)
        {
            await torrentServices.updateTorrentAsync(id, torrent);

            return(true);
        }
 public async Task <ActionResult <List <Torrentdetails> > > getFilteredTorrent([FromBody] Torrentdetails filter)
 {
     return(await torrentServices.getFilteredTorrentAsync(filter.title));
 }
 public async Task <ActionResult <bool> > createTorrent([FromBody] Torrentdetails details)
 {
     return(await torrentServices.createTorrentAsync(details));
 }
 public async Task updateTorrentAsync(string id, Torrentdetails updatedtorrent)
 {
     await torrentCollection.ReplaceOneAsync(torrent => torrent.id == id, updatedtorrent);
 }
        public async Task <Torrentdetails> getTorrentAsync(string id)
        {
            Torrentdetails torrent = await torrentCollection.Find <Torrentdetails>(docs => docs.id == id).FirstOrDefaultAsync();

            return(torrent);
        }
 public async Task RemoveAsync(Torrentdetails torrentin)
 {
     await torrentCollection.DeleteOneAsync(torrent => torrent.id == torrentin.id);
 }