iek.Framework.DataMapper
1.0.0
dotnet add package iek.Framework.DataMapper --version 1.0.0
NuGet\Install-Package iek.Framework.DataMapper -Version 1.0.0
<PackageReference Include="iek.Framework.DataMapper" Version="1.0.0" />
paket add iek.Framework.DataMapper --version 1.0.0
#r "nuget: iek.Framework.DataMapper, 1.0.0"
// Install iek.Framework.DataMapper as a Cake Addin #addin nuget:?package=iek.Framework.DataMapper&version=1.0.0 // Install iek.Framework.DataMapper as a Cake Tool #tool nuget:?package=iek.Framework.DataMapper&version=1.0.0
This framework contains 2 classes
- T4 entities generator: Creates a connection with the db, selects all the tables, and creates an entity for every table in C#
The T4 needs 2 appSettings
- "DataMapperEntityNamespace" the namespace entities
- "DataMapperEntityPath" the folder path to save the entities
And the connectionString
<add name="DataMapperConnectionString" connectionString="Server=tcp:184.168.47.19;Database=MyDB;User ID=MyUser;Password=123;" providerName="System.Data.SqlClient" />
Use: iek.DataMapper.T4.Instance().GenerateEntities(ConfigurationManager.AppSettings["DataMapperEntityPath"]);
- ORM Generic Pattern Context: This is like EntityFramework but with ADO.NET on a generic repository pattern.
The Context needs one appSetting and the connectionString
- "DataMapperEntityNamespace"
- "DataMapperConnectionString"
Use:
User user = DataMapper.Context.Instance().TAsync<User>("GetUserById", new { IdUser = 1 }).Result;
TAsync<User>: This is a generic method, you can use List<User> or a single entity to return the result GetUserById: name of your procedure in db IdUser: name of the parameter of the stored procedure, needs to be the same name and data type
Doubts: iekzaer@gmail.com
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 1,647 | 10/4/2016 |
This framework contains 2 classes
1. T4 entities generator: Creates a connection with the db, selects all the tables and creates a entity for every table in C#
The T4 needs 2 appSettings
1. "DataMapperEntityNamespace" the namespace entities
2. "DataMapperEntityPath" the folder path to save the entities
And the connectionString
<add name="DataMapperConnectionString" connectionString="Server=tcp:184.168.47.19;Database=MyDB;User ID=MyUser;Password=123;" providerName="System.Data.SqlClient" />
Use:
iek.DataMapper.T4.Instance().GenerateEntities(ConfigurationManager.AppSettings["DataMapperEntityPath"]);
2. ORM Generic Pattern Context: Is like a EntityFramework but with ADO.NET on generic reporistory pattern.
The Context needs one appSetting and the connectionString
1. "DataMapperEntityNamespace"
2. "DataMapperConnectionString"
Use:
User user = DataMapper.Context.Instance().TAsync<User>("GetUserById", new { IdUser = 1 }).Result;
TAsync<User>: This is a generic method, you can use List<User> or a single entity to return the result
GetUserById: name of you procedure in db
IdUser: name of parameter in storedProcedure, needs to be the same name and data type
Doubts: iekzaer@gmail.com