I've the following code:
public class Compagny
{
[BsonElement("compagnyName")]
public string[] CompagnyName { get; set; }
}
public async Task<ActionResult<IEnumerable<Film>>> GetAllFilms([FromBody] Compagny compagny)
{
var toReturn = await _filmCollection.Find(item => item.CompagnyOwner == compagny.CompagnyName[0]).ToListAsync();
return Ok(toReturn);
}
A user can be registered in multiple compagnies but with "compagny.CompagnyName[0]" i'm only able to get all the movies from the [index]'s compagny.
Do you guys know a simple way to compare and get all the movies from all the users's compagnies?
Thanks a lot!