orderdaostub.cs
来自「NHibernate简单DEMO」· CS 代码 · 共 56 行
CS
56 行
using System;
using System.Collections.Generic;
using BasicSample.Core.DataInterfaces;
using BasicSample.Core.Domain;
using BasicSample.Tests.TestFactories;
namespace BasicSample.Tests.Data.DaoTestDoubles
{
/// <summary>
/// Stub DAO that can be used in place of OrderDao to simulate communications with
/// the DB without actually talking to the DB.
/// </summary>
public class OrderDaoStub : IOrderDao
{
public List<Order> GetByExample(Order exampleInstance, params string[] propertiesToExclude) {
return new TestOrdersFactory().CreateOrders();
}
#region Not-Implemented DAO methods
public List<Order> GetOrdersPlacedBetween(DateTime startDate, DateTime endDate) {
throw new Exception("The method or operation is not implemented.");
}
public Order GetById(long id, bool shouldLock) {
throw new Exception("The method or operation is not implemented.");
}
public List<Order> GetAll() {
throw new Exception("The method or operation is not implemented.");
}
public Order GetUniqueByExample(Order exampleInstance, params string[] propertiesToExclude) {
throw new Exception("The method or operation is not implemented.");
}
public Order Save(Order entity) {
throw new Exception("The method or operation is not implemented.");
}
public Order SaveOrUpdate(Order entity) {
throw new Exception("The method or operation is not implemented.");
}
public void Delete(Order entity) {
throw new Exception("The method or operation is not implemented.");
}
public void CommitChanges() {
throw new Exception("The method or operation is not implemented.");
}
#endregion
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?