Created
September 15, 2015 02:43
-
-
Save fferegrino/a81cd436e4d631f1cf4d to your computer and use it in GitHub Desktop.
Post de alias creados por el usuario
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Ents = MyApp.DataAccess.Entities; | |
using Edt = MyApp.ViewModels.Editable; | |
public class Test | |
{ | |
public static void Main() | |
{ | |
Edt.Person person = | |
new Edt.Person { Name = "Verde Valle" }; | |
var otherPerson = MapPerson(person); | |
Console.WriteLine(otherPerson.Name); | |
} | |
public static Ents.Person MapPerson(Edt.Person person) | |
{ | |
Ents.Person p = new Ents.Person { Name = person.Name }; | |
return p; | |
} | |
} | |
namespace MyApp.DataAccess.Entities | |
{ | |
public class Person | |
{ | |
public string Name { get; set; } | |
} | |
} | |
namespace MyApp.ViewModels.Editable | |
{ | |
public class Person | |
{ | |
public string Name { get; set; } | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using EntityPerson = MyApp.DataAccess.Entities.Person; | |
using EditablePerson = MyApp.ViewModels.Editable.Person; | |
public class Test | |
{ | |
public static void Main() | |
{ | |
EditablePerson person = | |
new EditablePerson { Name = "Verde Valle" }; | |
var otherPerson = MapPerson(person); | |
Console.WriteLine(otherPerson.Name); | |
} | |
public static EntityPerson MapPerson(EditablePerson person) | |
{ | |
EntityPerson p = new EntityPerson { Name = person.Name }; | |
return p; | |
} | |
} | |
namespace MyApp.DataAccess.Entities | |
{ | |
public class Person | |
{ | |
public string Name { get; set; } | |
} | |
} | |
namespace MyApp.ViewModels.Editable | |
{ | |
public class Person | |
{ | |
public string Name { get; set; } | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public class Test | |
{ | |
public static void Main() | |
{ | |
MyApp.ViewModels.Editable.Person person = | |
new MyApp.ViewModels.Editable.Person { Name = "Verde Valle" }; | |
var otherPerson = MapPerson(person); | |
Console.WriteLine(otherPerson.Name); | |
} | |
public static MyApp.DataAccess.Entities.Person MapPerson(MyApp.ViewModels.Editable.Person person) | |
{ | |
MyApp.DataAccess.Entities.Person p = | |
new MyApp.DataAccess.Entities.Person { Name = person.Name }; | |
return p; | |
} | |
} | |
namespace MyApp.DataAccess.Entities | |
{ | |
public class Person | |
{ | |
public string Name { get; set; } | |
} | |
} | |
namespace MyApp.ViewModels.Editable | |
{ | |
public class Person | |
{ | |
public string Name { get; set; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment