开发者

how to get next and previous record id using linq to sql?

var product = db.Products.First(p => p.Id == 5);

In the product detail show page, show.aspx?Id=5, 开发者_如何学Python I want to get the previous and next product link.

How can I do that?

Should I connect to the database three times to get the current product and previous id and next id for generate links?


I have solved this problem by returning two entities.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜