Linq-to-SQLを使用してAreaクラスを作成しました。
次に、検証を実装できるように、同じ名前の部分クラスを作成します。
エラー1タイプ'
System.Data.Linq.Table<SeguimientoDocente.Area>
'を''に暗黙的に変換できませんSystem.Linq.IQueryable<SeguimientoDocente.Models.Area>
C:\ Users \ Sergio \ document \ 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
{
}
}
これがスクリーンショットです。