Interface IRepository<TModel>
Interface of RepositoryBase contract
Namespace: StoneCo.Framework.Data.Redis.Repositories
Assembly: cs.temp.dll.dll
Syntax
public interface IRepository<TModel>
where TModel : class, IModel
Type Parameters
Name | Description |
---|---|
TModel | The type of the response to be returned in the result. |
Methods
Add(Int64, TModel)
Stores an object into Redis Database.
Declaration
bool Add(long key, TModel model)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | key | Long type more than zero. |
TModel | model | Object that will be stored. |
Returns
Type | Description |
---|---|
System.Boolean | Boolean value that's represent success on operation. |
GetAndPopById(Int64)
Get an object defined 'TModel', passing a key and remove it of redis database.
Declaration
TModel GetAndPopById(long key)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | key | Long type more than zero. |
Returns
Type | Description |
---|---|
TModel | A object 'TModel' or null if not found. |
GetAndPopById(String)
Get an object defined 'TModel', passing a key and remove it of redis database.
Declaration
TModel GetAndPopById(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | String value that contains 12 characters. |
Returns
Type | Description |
---|---|
TModel | A object 'TModel' or null if not found. |
GetAndPopList(Int32)
Get a list of objects and remove their items from Redis Data.
Declaration
List<TModel> GetAndPopList(int quantity = 1)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | quantity | Max Number of itens that will be returned. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<TModel> | List with or without any itens. |
GetById(Int64)
Get an object defined 'TModel', passing a key.
Declaration
TModel GetById(long key)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | key | Long type more than zero. |
Returns
Type | Description |
---|---|
TModel | A object 'TModel' or null if not found. |
GetById(String)
Get an object defined 'TModel', passing a stored key.
Declaration
TModel GetById(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | String value that contains 12 characters. |
Returns
Type | Description |
---|---|
TModel | A object 'TModel' or null if not found. |
GetIncrementedDefaultKey()
Get next number of default sequence that represents a unique key.
Declaration
long GetIncrementedDefaultKey()
Returns
Type | Description |
---|---|
System.Int64 | A long type more than zero. |
GetList(Int32)
Get a list of objects from Redis Data.
Declaration
List<TModel> GetList(int quantity = 1)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | quantity | Max Number of itens that will be returned. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<TModel> | List with or without any itens. |