Show / Hide Table of Contents

Interface IDataStore

The generic interface that defines the functionality of a DataStore. A Data Store is the mechanism by which data can be retrieved from a data base, be it an XML file, SQL Server Database, Oracle Database, SQLite database, etc.

Namespace: spyderSoft.DataLayer.Core
Assembly: spyderSoft.DataLayer.Core.dll
Syntax
public interface IDataStore

Properties

| Improve this Doc View Source

DataStorePath

Gets or sets the means by which a connection can be made to a data base. In some cases a File Path, in Others a Connection string.

Declaration
string DataStorePath { get; set; }
Property Value
Type Description
System.String

The data store path.

Methods

| Improve this Doc View Source

DeleteItem(IDataItem)

Delete the item of type DataItem.

Declaration
void DeleteItem(IDataItem itemToDelete)
Parameters
Type Name Description
IDataItem itemToDelete

Item to be deleted

| Improve this Doc View Source

DeleteItems(IEnumerable<IDataItem>)

Delete a list of DataItem items.

Declaration
void DeleteItems(IEnumerable<IDataItem> itemsToDelete)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<IDataItem> itemsToDelete

List of items to be deleted

| Improve this Doc View Source

FixDynamicExpression<TDataContract>(Expression<Func<TDataContract, Boolean>>)

Takes a predicate that has been built dynamically and resolves all variables.

Declaration
Expression<Func<TDataContract, bool>> FixDynamicExpression<TDataContract>(Expression<Func<TDataContract, bool>> predicate)
    where TDataContract : class, IDataItem, new()
Parameters
Type Name Description
System.Linq.Expressions.Expression<System.Func<TDataContract, System.Boolean>> predicate

the expression to resolve

Returns
Type Description
System.Linq.Expressions.Expression<System.Func<TDataContract, System.Boolean>>

Expression<Func<TDataContract, System.Boolean>>.

Type Parameters
Name Description
TDataContract

The type of the Data Item

| Improve this Doc View Source

GetItem<TDataContract>(Int64)

Gets Item TDataContract using the Id of the item

Declaration
TDataContract GetItem<TDataContract>(long key)
    where TDataContract : class, IDataItem, new()
Parameters
Type Name Description
System.Int64 key

Key of the item

Returns
Type Description
TDataContract

Item of type TDataContract

Type Parameters
Name Description
TDataContract

Type of item

| Improve this Doc View Source

GetItems<TDataContract>()

Gets all Items of type TDataContract

Declaration
IEnumerable<TDataContract> GetItems<TDataContract>()
    where TDataContract : class, IDataItem, new()
Returns
Type Description
System.Collections.Generic.IEnumerable<TDataContract>

List of items of type TDataContract, or null if the collection is empty.

Type Parameters
Name Description
TDataContract

Type of item

| Improve this Doc View Source

GetItems<TDataContract>(Int32, Int32)

Gets all items of type TDataContract skipping the number of items specified by skip then taking the number of items specified by take.

Declaration
IEnumerable<TDataContract> GetItems<TDataContract>(int skip, int take)
    where TDataContract : class, IDataItem, new()
Parameters
Type Name Description
System.Int32 skip

The number of items to skip before taking items to return.

System.Int32 take

The number of items to take or return.

Returns
Type Description
System.Collections.Generic.IEnumerable<TDataContract>

List of items of type TDataContract, or null if the collection is empty.

Type Parameters
Name Description
TDataContract

Type of the item.

| Improve this Doc View Source

GetItems<TDataContract>(Expression<Func<TDataContract, Boolean>>)

Gets All items of type TDataContract using a LINQ predicate

Declaration
IEnumerable<TDataContract> GetItems<TDataContract>(Expression<Func<TDataContract, bool>> predicate)
    where TDataContract : class, IDataItem, new()
Parameters
Type Name Description
System.Linq.Expressions.Expression<System.Func<TDataContract, System.Boolean>> predicate

The predicate.

Returns
Type Description
System.Collections.Generic.IEnumerable<TDataContract>

List of items of type TDataContract, or null if the collection is empty.

Type Parameters
Name Description
TDataContract

Type of item

| Improve this Doc View Source

GetItems<TDataContract>(Expression<Func<TDataContract, Boolean>>, Int32, Int32)

Gets all items of type TDataContract using a LINQ predicate skipping the number of items specified by skip then taking the number of items specified by take.

Declaration
IEnumerable<TDataContract> GetItems<TDataContract>(Expression<Func<TDataContract, bool>> predicate, int skip, int take)
    where TDataContract : class, IDataItem, new()
Parameters
Type Name Description
System.Linq.Expressions.Expression<System.Func<TDataContract, System.Boolean>> predicate

The predicate.

System.Int32 skip

The number of items to skip before taking items to return.

System.Int32 take

The number of items to take or return.

Returns
Type Description
System.Collections.Generic.IEnumerable<TDataContract>

List of items of type TDataContract, or null if the collection is empty.

Type Parameters
Name Description
TDataContract

Type of item

| Improve this Doc View Source

GetItemsCount<TDataContract>()

Gets the count of all items of type TDataContract

Declaration
int GetItemsCount<TDataContract>()
    where TDataContract : class, IDataItem, new()
Returns
Type Description
System.Int32

Count of items

Type Parameters
Name Description
TDataContract

Type of item

| Improve this Doc View Source

GetItemsCount<TDataContract>(Expression<Func<TDataContract, Boolean>>)

Gets the count of all items of type TDataContract matching LINQ predicate

Declaration
int GetItemsCount<TDataContract>(Expression<Func<TDataContract, bool>> predicate)
    where TDataContract : class, IDataItem, new()
Parameters
Type Name Description
System.Linq.Expressions.Expression<System.Func<TDataContract, System.Boolean>> predicate

query predicate

Returns
Type Description
System.Int32

Count of items

Type Parameters
Name Description
TDataContract

Type of item

| Improve this Doc View Source

GetItemsQueryable<TDataContract>()

Gets the items queryable.

Declaration
IQueryable<TDataContract> GetItemsQueryable<TDataContract>()
    where TDataContract : class, IDataItem, new()
Returns
Type Description
System.Linq.IQueryable<TDataContract>

IQueryable<TDataContract>.

Type Parameters
Name Description
TDataContract

The type of the t data contract.

| Improve this Doc View Source

SaveItem<TDataContract>(TDataContract)

Save the item of type TDataContract

Declaration
TDataContract SaveItem<TDataContract>(TDataContract itemToSave)
    where TDataContract : class, IDataItem, new()
Parameters
Type Name Description
TDataContract itemToSave

item to be saved

Returns
Type Description
TDataContract

TDataContract.

Type Parameters
Name Description
TDataContract

Type of item

| Improve this Doc View Source

SaveItems<TDataContract>(IEnumerable<TDataContract>)

Save the list of items of type TDataContract

Declaration
IEnumerable<TDataContract> SaveItems<TDataContract>(IEnumerable<TDataContract> itemsToSave)
    where TDataContract : class, IDataItem, new()
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<TDataContract> itemsToSave

List of items to be saved

Returns
Type Description
System.Collections.Generic.IEnumerable<TDataContract>

IEnumerable<TDataContract>.

Type Parameters
Name Description
TDataContract

Type of item

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX