Error: 'System.Linq.IQueryable' does not contain a definition for 'Include' and no extension method 'Include' accepting a first argument of type 'System.Linq.IQueryable' could be found
Solution:
Add namespace System.Data.Entity;
Actually Include is not an extension method on Queryable, so it doesn't come with all the usual LINQ methods.
If you are using Entity Framework, you need to import namespace System.Data.Entity:
Showing posts with label ASP.NET MVC. Show all posts
Showing posts with label ASP.NET MVC. Show all posts
Wednesday, December 10, 2014
Thursday, November 6, 2014
DbArithmeticExpression arguments must have a numeric common type
dgvProfiles.DataSource = (from profile in dbModel.ProfileMasters
select new
{
ProfileID = profile.ProfileId,
Profile = profile.ClientName,
Tasks= profile.TaskMasters.Count(),
AverageTime = profile.TaskMasters.Select(x => EntityFunctions.DiffMinutes(x.StartTime, x.EndTime)).Average(y => (decimal?)y.Value),
LastTime = profile.TaskMasters.Max(x=>x.StartTime)
}).ToList();
Labels:
ASP.NET,
ASP.NET MVC,
C#.NET,
Lambda Expression,
LINQ
Thursday, April 3, 2014
The maximum message size quota for incoming messages (65536) has been exceeded
Saturday, March 22, 2014
Prevent addition of default paragraph tag by ckeditor
by ckeditor we have to add below lines in config.js
CKEDITOR.editorConfig = function (config) {
config.enterMode = CKEDITOR.ENTER_BR;
config.shiftEnterMode = CKEDITOR.ENTER_BR;
Labels:
ASP.NET,
ASP.NET MVC,
C#.NET,
Ckeditor
Thursday, March 13, 2014
HTTP could not register URL . Your process does not have access rights to this namespace
HTTP could not register URL http://+:8080/FileTranfer/.
Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details).
The issue is that the URL is being blocked from being created by Windows.
Steps to fix:
Run command prompt as an administrator.
Add the URL to the ACL netsh http add urlacl url=http://+:8080/FileTranfer/ user=mylocaluser
Labels:
ASP.NET,
ASP.NET MVC
Monday, January 13, 2014
Overwrite Appsetting in ASP.NET MVC
var config = WebConfigurationManager.OpenWebConfiguration("~");
config.AppSettings.Settings["appSettingKey"].Value ="Updated value";
config.Save(ConfigurationSaveMode.Minimal, false);
ConfigurationManager.RefreshSection("appSettings");
Subscribe to:
Posts (Atom)