c# - Error when trying to create a partial class -
I've created an area square using Linq-to-SQL.
Now I want to make a partial square of the same name so that I can apply verification. Any help
error 1 can not change the indirect type? '
System.Data.Linq.Table & LT; SeguimientoDocente.Area & gt;
'to'System.Linq.IQueryable & lt; SeguimientoDocente.Models.Area & gt;
'C: \ Users \ Sergio \ Documents \ Visual Studio 2010 \ Projects \ SeguimientoDocente \ SeguimientoDocente \ Model \ AreaRepository.cs 14 20 SeguimientoDocente
Using the system ; Using System.Collections.Generic; Using System.Linq; Using System.Web; Name SeguimientoDocente.Models {Public Category AreaRepository {Private SeguimientoDataContext db = new SeguimientoDataContext (); Public IQueryable & lt; Region & gt; FindAllAreas () {return db.Areas; } Public Areas GetArea (int id) {return db.Areas.SingleOrDefault (a => A.ID == ID); } Add Public Zero (Area Area) {db.Areas.InsertOnSubmit (Area); } Public Zero removal (area area) {db.Areas.DeleteOnSubmit (area); } Save Public Zero () {db.SubmitChanges (); }}} Using the system; Using System.Collections.Generic; Using System.Linq; Using System.Web; Name SeguimientoDocente.Models {Public Partial Classroom Area {}}
Here's a screenshot.
This is almost certainly because your partial orbit is not in the correct namespace, going into the LINQ model's .designer.cs file and looking for the field area generated, and make sure the namespace matches you in your partial square Are wrapped.
Edit
I have just set formatting in your question. The error message actually indicates that your partial class is in the wrong namespace.
Error 1 Hidden form type '
System.Data.Linq.Table & lt; SeguimientoDocente.Area & gt; / Code> 'From' to
System.Linq.IQueryable & lt; SeguimientoDocente.Models.Area & gt;
'
As you can see from the above error, you have to change the namespace is in your partial classroom SeguimientoDocente, not SeguimientoDocente.Models. As it stands now, they are two completely different incompatible types which are simple names.
Comments
Post a Comment