Skip to content

Custom .NET framework which will automate all your CRUD operation (Insert/Update/Delete/Get/GetAll). It will handle database connection ( open/close) and also contain helper methods for executing stored procedure/query

akshaytilekar7/generic-crud-framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

generic-crud-framework

Custom .NET framework

I have created custom framework similar to entity framework

This framework will automate code for insert/update/delete/read and various other operations (like Excute Stroed procedure/Query etc).

  • all core logic is in Database.Core project.
  • you just have to create enitity/model class
  • create object of my BaseEntity and pass your entity/model
  • that BaseEntity will provide various method for different database operations
  • Project has one Console application (name as "Test") which will show how to use my DataBase.Core

How To Use

  • just change connection string in ManageConnection.cs class
  • and create Model/Entity class (Sample class is in console application (Named as "Test") : Model/Student.cs)
    • Provide attributes on property that used in that class
      • [TableName("UrDataBaseTableName")]
      • [PrimaryKey]
      • [ColumnName("ColumnName")]
      • [IgnoreColumn]

Use BaseEntity as below :

  • BaseEntity baseEntity = new BaseEntity(ManageConnection.ConnectionString);

BaseEntity CRUD methods

 -  public BaseEntity(string connectionString)
 -  public int InsertEntity(Entity entity)
 -  public int UpdateEntity(Entity entity)
 -  public int DeleteEntity(int id)
 -  public MyType GetEntity(int id)
 -  public IEnumerable<MyType> GetAllEntities()

BaseEntity others methods

 -  public int ExecNonQuery(string query)
 -  public IEnumerable<MyType> ExcuteReader(string query)
 -  public object ExecScalar(string query)
 -  public object ExecScalarWithSP(string storeProcName)
 -  public int ExcuteNonQueryWithSP(string storeProcName)
 -  public IEnumerable<MyType> ExcuteReaderWithSP(string storeProcName)
 -  public List<Dictionary<string, object>> ExcuteReaderWithSPDyanamicList(string storeProcName)
 -  public Dictionary<string, object> ExcuteReaderWithSPDyanamicObject(string storeProcName)

About

Custom .NET framework which will automate all your CRUD operation (Insert/Update/Delete/Get/GetAll). It will handle database connection ( open/close) and also contain helper methods for executing stored procedure/query

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages