Skip to content
Elyor edited this page Aug 6, 2014 · 6 revisions

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:

  1. Type Mapping
  2. Drop table
  3. Exists table,
  4. Create table
  5. 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>();

  1. Getting Start

Clone this wiki locally