I have created a Area class using Linq-to-SQL.
Now I want to create a partial class of the same name so I can implement validation. Any help?
Error 1 Cannot implicitly convert type '
System.Data.Linq.Table<SeguimientoDocente.Area>
' to 'System.Linq.IQueryable<SeguimientoDocente.Models.Area>
' C:\Users\Sergio\documents\visual studio 2010\Projects\SeguimientoDocente\SeguimientoDocente\Models\AreaRepository.cs 14 20 SeguimientoDocente
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace SeguimientoDocente.Models
{
public class AreaRepository
{
private SeguimientoDataContext db = new SeguimientoDataContext();
public IQueryable<Area> FindAllAreas()
{
return db.Areas;
}
public Area GetArea(int id)
{
return db.Areas.SingleOrDefault(a => a.ID == id);
}
public void Add(Area area)
{
db.Areas.InsertOnSubmit(area);
}
public void Delete(Area area)
{
db.Areas.DeleteOnSubmit(area);
}
public void Save()
{
db.SubmitChanges();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace SeguimientoDocente.Models
{
public partial class Area
{
}
}
Here's a screenshot.