Step1: Select only the required data.
List<products> prodlist = ctx.Products
.Where(
x => SqlFunctions.DateAdd("s", x.SoldDateTime , "1970-01-01").Value.Year==DateTime.Now.Year &&
SqlFunctions.DateAdd("s", x.SoldDateTime , "1970-01-01").Value.Month==DateTime.Now.Month ).ToList();
</products>
Step2: I added Partial Class and not Mapped Property
namespace MyShop
{
public partial class Products
{
private DateTime s_date = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
public DateTime SDateTime
{
get
{
return s_date.AddSeconds(Convert.ToDouble(this.SoldDateTime)).ToLocalTime();
}
}
}
}
I would like to thanks
"Zoltan Zorgo" for this help.