mirror of https://github.com/ogoun/Zero.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1021 B
48 lines
1021 B
using System;
|
|
using System.Data;
|
|
using System.Data.Common;
|
|
|
|
namespace ZeroLevel.MsSql
|
|
{
|
|
public class SqlDbMapper<T> : BaseSqlDbMapper
|
|
{
|
|
protected readonly IDbMapper<T> _mapper;
|
|
|
|
protected override IDbMapper Mapper
|
|
{
|
|
get
|
|
{
|
|
return _mapper;
|
|
}
|
|
}
|
|
|
|
public IDbField IdentityField
|
|
{
|
|
get
|
|
{
|
|
return _mapper.IdentityField;
|
|
}
|
|
}
|
|
|
|
public SqlDbMapper(bool mapOnlyMarkedMembers) : base(typeof(T).Name)
|
|
{
|
|
_mapper = DbMapperFactory.Create<T>(mapOnlyMarkedMembers);
|
|
}
|
|
|
|
public T Deserialize(DataRow row)
|
|
{
|
|
return _mapper.Deserialize(row);
|
|
}
|
|
|
|
public T Deserialize(DbDataReader reader)
|
|
{
|
|
return _mapper.Deserialize(reader);
|
|
}
|
|
|
|
public void TraversalFields(Action<IDbField> callback)
|
|
{
|
|
_mapper.TraversalFields(callback);
|
|
}
|
|
}
|
|
}
|