相关疑难解决方法(0)

LINQ to Entities区分大小写比较

这不是LINQ to Entities中区分大小写的比较:

Thingies.First(t => t.Name == "ThingamaBob");
Run Code Online (Sandbox Code Playgroud)

如何与LINQ to Entities实现区分大小写的比较?

.net c# linq-to-entities entity-framework-4

110
推荐指数
4
解决办法
6万
查看次数

简单的linq to sql没有支持的SQL转换

我在BlogRepository中有这个

public IQueryable<Subnus.MVC.Data.Model.Post> GetPosts()
    {
        var query = from p in db.Posts
                    let categories = GetCategoriesByPostId(p.PostId)
                    let comments = GetCommentsByPostId(p.PostId)
                    select new Subnus.MVC.Data.Model.Post
                    {
                        Categories = new LazyList<Category>(categories),
                        Comments = new LazyList<Comment>(comments),
                        PostId = p.PostId,
                        Slug = p.Slug,
                        Title = p.Title,
                        CreatedBy = p.CreatedBy,
                        CreatedOn = p.CreatedOn,
                        Body = p.Body
                    };
        return query;
    }
Run Code Online (Sandbox Code Playgroud)

public IQueryable<Subnus.MVC.Data.Model.Comment> GetCommentsByPostId(int postId)
    {
        var query = from c in db.Comments
                    where c.PostId == postId
                    select new Subnus.MVC.Data.Model.Comment
                    {
                        Body = c.Body,
                        EMail = …
Run Code Online (Sandbox Code Playgroud)

.net linq-to-sql c#-3.0

22
推荐指数
1
解决办法
3万
查看次数