i have converted by project from dotnet core 2.1 to dotnet 6. i am in the process of converting it step by step. the thing which i am stuck now is where clause. i am not able to run this simple query in repository
public IQueryable<PostType> getPostType()
{
var d= _context.PostType.Where(e => e.PostStatusId==2).ToList(); // this thing is not working
return _context.PostType.Where(e => e.PostStatusId == 2);
}
anyone can get why? queries are working before
this is the result
Posttype
CREATE TABLE [dbo].[PostType](
[PostTypeId] [int] NOT NULL,
[PostTypeGuid] [uniqueidentifier] NULL,
[ParentId] [int] NULL,
[CategoryId] [int] NULL,
[Name] [varchar](100) NOT NULL,
[Slug] [varchar](500) NULL,
[ThumbnailImg] [nvarchar](255) NULL,
[WebSiteId] [int] NULL,
[PostStatusId] [int] NOT NULL,
[isMediaType] [bit] NOT NULL,
[isNewsletter] [bit] NOT NULL,
[AllowableExtension] [varchar](100) NULL,
[CreatedBy] [int] NULL,
[CreatedDate] [datetime] NULL,
[ModifiedBy] [int] NULL,
[ModifiedDate] [datetime] NULL,
CONSTRAINT [PK_PostType] PRIMARY KEY CLUSTERED
(
[PostTypeId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 80) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[PostType] ADD CONSTRAINT [DF_PostType_PostTypeGuid] DEFAULT (newid()) FOR [PostTypeGuid]
GO
ALTER TABLE [dbo].[PostType] ADD CONSTRAINT [DF_PostType_int_PostStatusId] DEFAULT ((2)) FOR [PostStatusId]
GO