Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bisand/dataorm
Lightweight ORM
https://github.com/bisand/dataorm
Last synced: 7 days ago
JSON representation
Lightweight ORM
- Host: GitHub
- URL: https://github.com/bisand/dataorm
- Owner: bisand
- License: mit
- Created: 2014-09-05T11:46:33.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2024-01-16T19:17:21.000Z (12 months ago)
- Last Synced: 2024-11-08T16:12:22.445Z (2 months ago)
- Language: C#
- Size: 124 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
DataOrm
=======## Lightweight O(R)M for .NET Core
This is a lightweight Object Relational Mapper for querying databases with SQL and returning a list of strongly typed objects. You can also insert, update and retrive "navigational properties".
## Database support
* SQL Server
* MySQL
## Examples### SELECT
```csharp
var connectionString = "Data Source=localhost;Initial Catalog=Test;Integrated Security=True;Connect Timeout=15;Encrypt=False;TrustServerCertificate=False";
using (var session = DataOrmServer.CreateSession(SessionType.SqlServer, connectionString))
{
var result = session.Query("SELECT * FROM Activities");
Assert.IsNotNull(result);
Assert.IsTrue(result.Count > 0);
}
```### INSERT
```csharp
var connectionString = "user=test;password=SuperStrongPassword!;server=localhost;database=test;Character Set=utf8";
using (var session = DataOrmServer.CreateSession(SessionType.MySql, connectionString))
{
var list = new List();
for (int i = 0; i < 10000; i++)
{
list.Add(new EntityNormalizedValue
{
TransactionId = i,
BrandId = "Brand ID " + i,
BrandName = "Brand name " + i,
});
}
session.InsertData(list);
}
```## Contributing
Pull requests for new features, bug fixes, and suggestions are welcome!
## License
[MIT](https://github.com/bisand/DataOrm/blob/master/LICENSE)