MapTo/test/TestConsoleApp/Program.cs

30 lines
817 B
C#
Raw Normal View History

2021-02-07 13:51:49 +03:00
using System;
using TestConsoleApp.Data.Models;
using TestConsoleApp.ViewModels;
2021-01-27 10:53:29 +03:00
namespace TestConsoleApp
{
internal class Program
{
private static void Main(string[] args)
{
2021-02-07 13:51:49 +03:00
var user = new User
{
Id = 1234,
RegisteredAt = DateTimeOffset.Now,
Profile = new Profile
{
FirstName = "John",
LastName = "Doe"
}
};
var vm = user.ToUserViewModel();
Console.WriteLine("Key: {0}", vm.Key);
Console.WriteLine("RegisteredAt: {0}", vm.RegisteredAt);
Console.WriteLine("FirstName: {0}", vm.Profile.FirstName);
Console.WriteLine("LastName: {0}", vm.Profile.LastName);
2021-01-27 10:53:29 +03:00
}
}
}