RepositorySql Help

Jul 11, 2011 at 11:35 PM

Any example how to use RepositorySql !?

Coordinator
Jul 12, 2011 at 4:19 PM

Hi, ... see description and sample files listed below

 

REPOSITORYSQL

Description: Provides base implementation against a SQL repository for searching entities using methods FindRecent, and Find.

Notes: For creating your own repository for an entity, you need to 

1. Extend this class and implement the Create/Update methods and implement RowMapper. See sample implemention below:

2. Create 2 stored procedures, using naming format <Entity>_GetByFilter and <Entity>_GetRecent. See sample stored procs below.

Sample Implementation: <ROOT>\src\Lib\CommonLibrary.NET\Account\UserRepository.cs

Sample Stored Procs: <ROOT>\install\database\install_model_User.sql

Example: <ROOT>\src\Lib\CommonLibrary.NET\_Samples\Example_Repository2_Entity.cs ( Uses a RepositoryInMemory rather than RepositorySql, but examples are same regardless )

 

 

REPOSITORYBASE

Description: Base class Repository for persisting entities.

1. Provides aggregate functionality: ( sum, min, max, count, avg, distinct, group by ) by column names ( using Expression tree entity properties as column names )

2. Provides lookup tables for mapping entities and putting them into a dictionary3. Provides CRUD ( create, get, update, delete, copy  ) methods ( Create and Update methods are abstract )

 

 

REPOSITORYQUERYABLE 

Description: Base class for all Repository classes

1. Provides aggregate functionality: ( sum, min, max, count, avg, distinct, group by )

2. Can be used without entities( On any table )

Example: <ROOT>\src\lib\CommonLibrary.NET\_Samples\RepositoryQueryable.cs

 

- Kishore