• Share
    • Twitter
    • LinkedIn
    • Facebook
    • Email
  • Feedback
  • Improve this Doc

Class PetaPocoRepository<T>

Inheritance
System.Object
RepositoryBase<T>
PetaPocoRepository<T>
Implements
IRepository<T>
Inherited Members
RepositoryBase<T>.CacheArgs
RepositoryBase<T>.Scope
RepositoryBase<T>.IsCacheable
RepositoryBase<T>.IsScoped
RepositoryBase<T>.Delete(T)
RepositoryBase<T>.Get()
RepositoryBase<T>.Get<TScopeType>(TScopeType)
RepositoryBase<T>.GetById<TProperty>(TProperty)
RepositoryBase<T>.GetById<TProperty, TScopeType>(TProperty, TScopeType)
RepositoryBase<T>.GetPage(Int32, Int32)
RepositoryBase<T>.GetPage<TScopeType>(TScopeType, Int32, Int32)
RepositoryBase<T>.Insert(T)
RepositoryBase<T>.Update(T)
RepositoryBase<T>.Initialize(String, Int32, CacheItemPriority, String)
RepositoryBase<T>.CompareTo<TProperty>(TProperty, TProperty)
RepositoryBase<T>.GetPropertyValue<TProperty>(T, String)
RepositoryBase<T>.GetPrimaryKey<TProperty>(T)
RepositoryBase<T>.GetScopeValue<TProperty>(T)
Namespace: DotNetNuke.Data.PetaPoco
Assembly: DotNetNuke.dll
Syntax
public class PetaPocoRepository<T> : RepositoryBase<T>, IRepository<T> where T : class
Type Parameters
Name Description
T

Constructors

| Improve this Doc View Source

PetaPocoRepository(Database, IMapper)

Initializes a new instance of the PetaPocoRepository<T> class.

Declaration
public PetaPocoRepository(Database database, IMapper mapper)
Parameters
Type Name Description
Database database
IMapper mapper

Methods

| Improve this Doc View Source

Delete(String, Object[])

Delete items from the repository based on a sql Condition.

Declaration
public override void Delete(string sqlCondition, params object[] args)
Parameters
Type Name Description
System.String sqlCondition

The sql condition e.g. "WHERE ArticleId = {0}".

System.Object[] args

A collection of arguments to be mapped to the tokens in the sqlCondition.

Overrides
DotNetNuke.Data.RepositoryBase<T>.Delete(System.String, System.Object[])
| Improve this Doc View Source

DeleteInternal(T)

Declaration
protected override void DeleteInternal(T item)
Parameters
Type Name Description
T item
Overrides
DotNetNuke.Data.RepositoryBase<T>.DeleteInternal(T)
| Improve this Doc View Source

Find(Int32, Int32, String, Object[])

Find a GetPage of items from the repository based on a sql condition.

Declaration
public override IPagedList<T> Find(int pageIndex, int pageSize, string sqlCondition, params object[] args)
Parameters
Type Name Description
System.Int32 pageIndex

The page Index to fetch.

System.Int32 pageSize

The size of the page to fetch.

System.String sqlCondition

The sql condition e.g. "WHERE ArticleId = @0".

System.Object[] args

A collection of arguments to be mapped to the tokens in the sqlCondition.

Returns
Type Description
IPagedList<T>

A list of items.

Overrides
DotNetNuke.Data.RepositoryBase<T>.Find(System.Int32, System.Int32, System.String, System.Object[])
Remarks

Find supports both full SQL statements such as "SELECT * FROM table WHERE ..." as well as a SQL condition like "WHERE ...".

| Improve this Doc View Source

Find(String, Object[])

Find items from the repository based on a sql condition.

Declaration
public override IEnumerable<T> Find(string sqlCondition, params object[] args)
Parameters
Type Name Description
System.String sqlCondition

The sql condition e.g. "WHERE ArticleId = @0".

System.Object[] args

A collection of arguments to be mapped to the tokens in the sqlCondition.

Returns
Type Description
IEnumerable<T>

A list of items.

Overrides
DotNetNuke.Data.RepositoryBase<T>.Find(System.String, System.Object[])
Remarks

Find supports both full SQL statements such as "SELECT * FROM table WHERE ..." as well as a SQL condition like "WHERE ...".

| Improve this Doc View Source

GetByIdInternal(Object)

Declaration
protected override T GetByIdInternal(object id)
Parameters
Type Name Description
System.Object id
Returns
Type Description
T
Overrides
DotNetNuke.Data.RepositoryBase<T>.GetByIdInternal(System.Object)
| Improve this Doc View Source

GetByScopeInternal(Object)

Declaration
protected override IEnumerable<T> GetByScopeInternal(object propertyValue)
Parameters
Type Name Description
System.Object propertyValue
Returns
Type Description
IEnumerable<T>
Overrides
DotNetNuke.Data.RepositoryBase<T>.GetByScopeInternal(System.Object)
| Improve this Doc View Source

GetInternal()

Declaration
protected override IEnumerable<T> GetInternal()
Returns
Type Description
IEnumerable<T>
Overrides
DotNetNuke.Data.RepositoryBase<T>.GetInternal()
| Improve this Doc View Source

GetPageByScopeInternal(Object, Int32, Int32)

Declaration
protected override IPagedList<T> GetPageByScopeInternal(object propertyValue, int pageIndex, int pageSize)
Parameters
Type Name Description
System.Object propertyValue
System.Int32 pageIndex
System.Int32 pageSize
Returns
Type Description
IPagedList<T>
Overrides
DotNetNuke.Data.RepositoryBase<T>.GetPageByScopeInternal(System.Object, System.Int32, System.Int32)
| Improve this Doc View Source

GetPageInternal(Int32, Int32)

Declaration
protected override IPagedList<T> GetPageInternal(int pageIndex, int pageSize)
Parameters
Type Name Description
System.Int32 pageIndex
System.Int32 pageSize
Returns
Type Description
IPagedList<T>
Overrides
DotNetNuke.Data.RepositoryBase<T>.GetPageInternal(System.Int32, System.Int32)
| Improve this Doc View Source

InsertInternal(T)

Declaration
protected override void InsertInternal(T item)
Parameters
Type Name Description
T item
Overrides
DotNetNuke.Data.RepositoryBase<T>.InsertInternal(T)
| Improve this Doc View Source

Update(String, Object[])

Update items in the repository based on a sql Condition.

Declaration
public override void Update(string sqlCondition, params object[] args)
Parameters
Type Name Description
System.String sqlCondition

The sql condition e.g. "SET ArticelName = @1 WHERE ArticleId = @0".

System.Object[] args

A collection of arguments to be mapped to the tokens in the sqlCondition.

Overrides
DotNetNuke.Data.RepositoryBase<T>.Update(System.String, System.Object[])
| Improve this Doc View Source

UpdateInternal(T)

Declaration
protected override void UpdateInternal(T item)
Parameters
Type Name Description
T item
Overrides
DotNetNuke.Data.RepositoryBase<T>.UpdateInternal(T)

Implements

IRepository<T>

Extension Methods

JsonExtensionsWeb.ToJson(Object)
  • View Source
Back to top by the community, for the community... #DNNCMS