我有以下实体
1. tbl_city
City_id pk AI
City_name
2. tbl_area
area_id pk
area_name
city_id fk tbl_city(city_id)
3. tbl_restaurant
restaurant_id pk
restaurant_name
4. tbl_restaurant_areas
restaurant_area_id pk
area_id fk tbl_area(area_id)
restaurant_id fk tbl_restaurant(restauran_id)
现在我有一个接受两个参数city_id
和restaurant_id
的方法,它们应该从tbl_area
中选择tbl_restaurant_areas
中不存在的区域from a in ctx.tbl_areas where a.city_id==city_id && !ctx.tbl_restaurant_areas
.Any(ra => (ra.area_id==a.area_id) && ra.reastaurant_id==restaurant_id)
select new {a};
。我的LINQ查询如下所示
var myObject = {
name: "Peter Foti",
'course': 'JavaScript',
grade: 'A',
level: 3
};