I have 2 entities that are related as one to many
public class Restaurant { public int RestaurantId {get;set;} public string Name {get;set;} public
This happens because of the 2 way relationship between your data model when it comes to be JSON serialized.
You should not return your data model diectly. Map it to a new response model then return it.