<P>DataMapper1.2创建Mapper实例没有错,可1.6出错,老是报Null值,在网上没搜到最新版本的,哪位可以做一个最新版本的小例子?谢谢</P>
问题补充:
那个我看过了,我只想用DataMapper, NpetShop里用了DataAccess
using IBatisNet.Common.Utilities;
using IBatisNet.DataMapper;
using IBatisNet.DataMapper.Configuration;
/// <summary>
/// Mapper 的摘要说明。
/// </summary>
namespace LiveBookings
{
public class Mapper
{
private static volatile SqlMapper _mapper = null;
protected static void Configure(object obj)
{
_mapper = (SqlMapper)obj;
}
protected static void InitMapper()
{
ConfigureHandler handler = new ConfigureHandler(Configure);
_mapper = SqlMapper.ConfigureAndWatch(handler);
}
public static SqlMapper Instance()
{
if (_mapper == null)
{
lock (typeof(SqlMapper))
{
if (_mapper == null) // double-check
InitMapper();
}
}
return _mapper;
}
public static SqlMapper Get()
{
return Instance();
}
}
}
提示这里出错
ConfigureHandler handler = new ConfigureHandler(Configure);
_mapper = SqlMapper.ConfigureAndWatch(handler);
但是换成旧版本的就没错Anders Cui和阿不,我就是学习的你们的文章,但是你们的例子也是旧版本的,不过还是非常感谢。
敏捷的水
|
初学一级
|
园豆:
170
提问于:2007-11-12 21:07