For example
/// Get
public IQueryable<ChtAlarmEvent> GetList(Func<ChtAlarmEvent, bool> filter)
{
var entities = this._dbContext.ChtAlarmEvents.Where(filter).AsQueryable();
return entities;
}
|
Unit Test
[TestMethod]
public void TestGetList()
{
using (var da = new ChtAlarmEventDAL(chtContext))
{
var entities = da.GetList(x => x.Severity == Severity.Critical.ToString());
foreach (var data in entities){
Debug.WriteLine("UUID : " + data.UUID);
}
entities = null;
}
}
|
沒有留言:
張貼留言