Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Post de alias creados por el usuario
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; }
}
}
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; }
}
}
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
You can’t perform that action at this time.