using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication3
{
class Program
{
static void Main(string[] args)
{
BookModel a=new BookModel();
a.ToDomainModel();
BookDomainModel b =new BookDomainModel();
b.ToModel();
}
}
public class BookModel
{
public int Id { get; set; }
public string Name { get; set; }
}
public class BookDomainModel
{
public int Id { get; set; }
public string Name { get; set; }
}
public static class MappingExtension
{
// convert the adapter domain model to prensentation model
public static BookModel ToModel(this BookDomainModel domainModel)
{
var model = new BookModel();
// to do mapping
return model;
}
// convert the UI model to Domain model
public static BookDomainModel ToDomainModel(this BookModel model)
{
var domain = new BookDomainModel();
// to do mapping
return domain;
}
}
}