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.
|
|
|
|
using System;
|
|
|
|
|
using System.Data.SqlClient;
|
|
|
|
|
using ZeroLevel.SqlServer;
|
|
|
|
|
using ZeroLevel.Specification;
|
|
|
|
|
|
|
|
|
|
namespace ZeroLevel.SqlServer
|
|
|
|
|
{
|
|
|
|
|
public class SqlIdentitySpecification<T> : IdentitySpecification<T>, ISqlServerSpecification
|
|
|
|
|
where T : IEntity
|
|
|
|
|
{
|
|
|
|
|
public SqlIdentitySpecification(Guid id) : base(id)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public SqlParameter[] Parameters
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return new SqlParameter[]
|
|
|
|
|
{
|
|
|
|
|
new SqlParameter(DbMapperFactory.Create<T>().IdentityField.Name, _id)
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string Query
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return string.Empty;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static ISpecification<Te> Create<Te>(Guid id) where Te: IEntity
|
|
|
|
|
{ return new SqlIdentitySpecification<Te>(id); }
|
|
|
|
|
}
|
|
|
|
|
}
|