我正在尝试用两个表做出请求
表页:Id,LangId(主键)PageTypeId,PageTypeLangId(外键)
表PageType:Id,LangId(主键)
那怎么办?在这里,我想念只是添加PageTypeLangId
return context.Pages
.Join(context.PageTypes, p => p.PageTypeId, pT => pT.Id,(p, pT) => new { p, pT })
Run Code Online (Sandbox Code Playgroud)
我想要 :
select * from Page inner join PageType on Page.PageTypeId=PageType.Id and Page.PageTypeLangId=PageType.LangId
Run Code Online (Sandbox Code Playgroud)
谢谢你的帮助 !
我有一个关于使用Newtonsoft JSON.NET库进行反序列化/序列化的问题:
我收到这个json:
{
"customerName" : "Lorem",
"id": 492426
"sequence": 1232132
"type" : 3,
"status" : 0,
"streetNumber" : 9675,
"streetName" : "Lorem",
"suite" : null,
"city" : "IPSUM",
"provinceCode" : "QC",
"postalCode" : "H1P1Z3",
"routeNumber" : 0,
"poBox" : 0,
"streetType" : "CH",
"userId" : 25,
"streetDirection" : null,
"countryCode" : "CA",
"customerNickName" : "Lorem ipsum",
"streetSuffix" : null,
"contacts" : [ {
"status" : 0,
"telephone" : 4445555555,
"extension" : 0,
"email" : "webtest@test.com",
"id" : 50,
"fullName" …Run Code Online (Sandbox Code Playgroud) 我在这里使用示例表单asp.net
所以,我问我,2个代码有什么区别:
public class ServiceTest
{
public Task<List<Widget>> WidgetsAsync(CancellationToken cancellationToken = default(CancellationToken))
{
var widgetService = new WidgetService();
return widgetService.GetWidgetsAsync(cancellationToken);
}
public Task<List<Product>> ProductAsync(CancellationToken cancellationToken = default(CancellationToken))
{
var prodService = new ProductService();
return prodService.GetProductsAsync(cancellationToken);
}
public Task<List<Gizmo>> GizmoAsync(CancellationToken cancellationToken = default(CancellationToken))
{
var gizmoService = new GizmoService();
return gizmoService.GetGizmosAsync(cancellationToken);
}
}
Run Code Online (Sandbox Code Playgroud)
和
public class ServiceTest
{
public async Task<List<Widget>> WidgetsAsync(CancellationToken cancellationToken = default(CancellationToken))
{
var widgetService = new WidgetService();
return await widgetService.GetWidgetsAsync(cancellationToken);
}
public async Task<List<Product>> ProductAsync(CancellationToken …Run Code Online (Sandbox Code Playgroud)