GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ThatRendle/Simple.Data: A light-weight, dynamic data access component for C# 4.0

BranchesTags
Open more actions menu

Latest commit

 

History

721 Commits
721 Commits

Folders and files

NameName
Last commit message
Last commit date
Assemblies
Assemblies
 
 
PerformanceTestConsole
PerformanceTestConsole
 
 
ProfilingApp
ProfilingApp
 
 
Releases
Releases
 
 
Simple.Data.AdapterApi
Simple.Data.AdapterApi
 
 
Simple.Data.Ado.Test
Simple.Data.Ado.Test
 
 
Simple.Data.Ado
Simple.Data.Ado
 
 
Simple.Data.BehaviourTest
Simple.Data.BehaviourTest
 
 
Simple.Data.InMemoryTest
Simple.Data.InMemoryTest
 
 
Simple.Data.Mocking.Test
Simple.Data.Mocking.Test
 
 
Simple.Data.Mocking
Simple.Data.Mocking
 
 
Simple.Data.SqlCe35
Simple.Data.SqlCe35
 
 
Simple.Data.SqlCe35Test
Simple.Data.SqlCe35Test
 
 
Simple.Data.SqlCe40
Simple.Data.SqlCe40
 
 
Simple.Data.SqlCe40Test
Simple.Data.SqlCe40Test
 
 
Simple.Data.SqlServer
Simple.Data.SqlServer
 
 
Simple.Data.SqlTest
Simple.Data.SqlTest
 
 
Simple.Data.TestHelper
Simple.Data.TestHelper
 
 
Simple.Data.UnitTest
Simple.Data.UnitTest
 
 
Simple.Data
Simple.Data
 
 
packages
packages
 
 
.gitignore
.gitignore
 
 
AutoTest.config
AutoTest.config
 
 
CommonAssemblyInfo.cs
CommonAssemblyInfo.cs
 
 
LICENSE.txt
LICENSE.txt
 
 
NugetPackAll.cmd
NugetPackAll.cmd
 
 
NugetPushAll.cmd
NugetPushAll.cmd
 
 
PerformanceTestConsole.psess
PerformanceTestConsole.psess
 
 
PerformanceTestConsole111123.vsp
PerformanceTestConsole111123.vsp
 
 
README.md
README.md
 
 
Simple.Data-Mono.sln
Simple.Data-Mono.sln
 
 
Simple.Data-Mono.userprefs
Simple.Data-Mono.userprefs
 
 
Simple.Data.sln
Simple.Data.sln
 
 
Simple.Data.sln.DotSettings
Simple.Data.sln.DotSettings
 
 
Simple.Data.userprefs
Simple.Data.userprefs
 
 
Simple.Data.vsmdi
Simple.Data.vsmdi
 
 
Simple_Data.ndproj
Simple_Data.ndproj
 
 
cleanup.sh
cleanup.sh
 
 
replacenugetversion.sh
replacenugetversion.sh
 
 

Repository files navigation

Simple.Data

A lightweight, dynamic data access component for .NET, written in C#.

What is it?

Prompted by the need for an easy-to-use database access component which prevents SQL injection attacks while not requiring lots of boilerplate ADO.NET code or a pre-generated ORM model. Inspired by Ruby's ActiveRecord and DataMapper gems.

Instead of

public User FindUserByEmail(string email)
{
	User user = null;
    using (var connection = new SqlConnection(ConfigurationManager.ConnectionStrings["Default"].ConnectionString))
    using (var command = new SqlCommand("select id, email, hashed_password, salt from users where email = @email", connection))
    {
        command.Parameters.Add("@email", SqlDbType.NVarChar, 50).Value = form.Email);
	    connection.Open();
	    using (var reader = command.ExecuteReader())
	    {
		    if (reader.Read())
		    {
			    user = new User {Id = reader.GetInt32(0), Email = reader.GetString(1), Password = reader.GetString(2), salt = reader.GetString(3)};
			}
		}
	}
	return user;
}

why not just write

public User FindUserByEmail(string email)
{
	return Database.Open().Users.FindAllByEmail(email).FirstOrDefault();
}

and take the rest of the morning off?

Simple.Data does this by using the dynamic features of .NET 4 to interpret method and property names at runtime and map them to your underlying data-store with a convention-based approach. For the code above, there is no pre-defined type with a Users property, and no FindByEmail method. Within Simple.Data, that single line of code is converted into all the ADO.NET boilerplate for you.

Multiple database and NoSQL store support

Because Simple.Data provides a sort of dynamic Domain Specific Language to represent queries, inserts, updates and deletes, it is able to support not only a wide range of RDBMS engines, but also non-SQL-based data stores such as MongoDB. It has an open and flexible model of Adapters and Providers which make it simple to write plug-ins to map to almost any back-end.

Currently, Simple.Data has adapters for:

  • ADO-based access to relational databases, with providers for:
    • SQL Server 2005 and later (including SQL Azure)
    • SQL Server Compact Edition 4.0
    • Oracle
    • MySQL 4.0 and later
    • SQLite
    • PostgreSQL
    • SQLAnywhere
    • Informix
  • MongoDB
  • OData

Work is in progress to support Azure Table Storage. I'm also ensuring that Simple.Data works on Mono by the 1.0 release.

If you'd like to create an adapter or provider and need some help to get started, drop in on the mailing list (see below).

Resources

  • Simple.Data can be installed from NuGet
  • Find more information in the wiki
  • Documentation! (and here is the SimpleFx Github Project if you want to help us improve the documentation)
  • Ask questions or report issues on the mailing list
  • Follow @markrendle on Twitter for updates
  • Check out my blog for the latest news

Click here to lend your support to: Simple.Data and make a donation at www.pledgie.com !

About

A light-weight, dynamic data access component for C# 4.0

Resources

Readme
MIT license
Activity

Stars

1.3k stars

Watchers

128 watching

Forks

298 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.