C# Class Phun.Data.SqlContentRepository

IContentRepository implementation for SQL store.
Inheritance: AContentRepository, IContentRepository
Datei anzeigen Open project: noogen/phuncms Class Usage Examples

Protected Properties

Property Type Description
CachePath string
ConnectionStringName string
DataRepository ISqlDataRepository
TableName string

Public Methods

Method Description
Exists ( ContentModel content ) : bool

Check for exist of content.

List ( ContentModel content ) : IQueryable

Lists the specified content.Path

Remove ( ContentModel content ) : void

Removes the specified content path or route.

Retrieve ( ContentModel content, bool includeData = true ) : ContentModel

Populate or gets the content provided specific host, path, and name property.

Save ( ContentModel content ) : void

Saves the specified content.

SqlContentRepository ( IMapRouteConfiguration config ) : System

Initializes a new instance of the SqlContentRepository class.

SqlContentRepository ( ISqlDataRepository dataRepo, string connectionStringName, string tableName, string cachePath ) : System

Initializes a new instance of the SqlContentRepository class.

Protected Methods

Method Description
EnsureSchema ( ) : void

Ensures the schema.

Private Methods

Method Description
Initialize ( ISqlDataRepository dataRepo, string connectionStringName, string tableName, string cachePath ) : void

Initializes the specified data repo.

Save ( ContentModel content, DapperContext db ) : void

Method Details

EnsureSchema() protected method

Ensures the schema.
protected EnsureSchema ( ) : void
return void

Exists() public method

Check for exist of content.
public Exists ( ContentModel content ) : bool
content ContentModel The content - requires host, path, and name property.
return bool

List() public method

Lists the specified content.Path
public List ( ContentModel content ) : IQueryable
content ContentModel The content.
return IQueryable

Remove() public method

Removes the specified content path or route.
public Remove ( ContentModel content ) : void
content ContentModel The content - requires host, path, and name property. If name is set to "*" then removes all for host and path.
return void

Retrieve() public method

Populate or gets the content provided specific host, path, and name property.
public Retrieve ( ContentModel content, bool includeData = true ) : ContentModel
content ContentModel The content - requires host, path, and name property.
includeData bool if set to true [include data].
return ContentModel

Save() public method

Saves the specified content.
public Save ( ContentModel content ) : void
content ContentModel The content - requires host, path, and name property.
return void

SqlContentRepository() public method

Initializes a new instance of the SqlContentRepository class.
public SqlContentRepository ( IMapRouteConfiguration config ) : System
config IMapRouteConfiguration The config.
return System

SqlContentRepository() public method

Initializes a new instance of the SqlContentRepository class.
Connection does not exist.
public SqlContentRepository ( ISqlDataRepository dataRepo, string connectionStringName, string tableName, string cachePath ) : System
dataRepo ISqlDataRepository The data repo.
connectionStringName string Name of the connection string.
tableName string Name of the table.
cachePath string The cache path.
return System

Property Details

CachePath protected_oe property

The cache path
protected string CachePath
return string

ConnectionStringName protected_oe property

The connection string name
protected string ConnectionStringName
return string

DataRepository protected_oe property

The data repository
protected ISqlDataRepository DataRepository
return ISqlDataRepository

TableName protected_oe property

The table name
protected string TableName
return string