-
Notifications
You must be signed in to change notification settings - Fork 3
Home
Welcome to the DapperRepository wiki!
This Repository cloning and changed to Drapper ORM micro framework.
And I this two libs in changes table , wrote here:
I fix to this issue list:
- Type Mapping
- Drop table
- Exists table,
- Create table
- DbFactory
Demonstration
Model:
public class TempModel
{
public TempModel()
{
LastModifiedDate = DateTime.Now;
CreatedDate = DateTime.Now;
}
`public long ID { get; set; }`
`public string Version { get; set; }`
`public string Name { get; set; }`
`public DateTime CreatedDate { get; set; }`
`public DateTime LastModifiedDate { get; set; }`
`}`
Mapper:
public class TempModelMapper : ClassMapper<TempModel>
{
public TempModelMapper()
{
Table("BusinessView");
`Map(f => f.ID).Column("Id").Key(KeyType.Identity);`
`Map(f => f.Version).Column("Version");`
`Map(f => f.Name).Column("Name");`
`Map(f => f.CreatedDate).Column("CreatedDate");`
`Map(f => f.LastModifiedDate).Column("LastModifiedDate");`
`Schema("");`
`}`
`}`
Connection Strings:
<appSettings>
<add key="ConnectionString" value="Data Source=localhost;Initial Catalog=TempDb;User Id=sa;Password=web@1234"/>
</appSettings>
Migrations:
var connectionString = ConfigurationManager.AppSettings["ConnectionString"];
RepositoryHelper.ConfigureRepository(new SqlServerManager(connectionString));
MigrationHelper.Configure<TempModel>();
Posted by Elyor
- Getting Start