Skip to content

Instantly share code, notes, and snippets.

@explorer14
Last active July 14, 2021 22:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save explorer14/479cc1b790b0ba61fc5c7155d6c35cb2 to your computer and use it in GitHub Desktop.
Save explorer14/479cc1b790b0ba61fc5c7155d6c35cb2 to your computer and use it in GitHub Desktop.
using Genny;
using System;
using System.Collections.Generic;
using System.Linq;
namespace ConsoleApp9.Domain
{
[GenerateMappedDto]
public sealed class Employee
{
public Employee(
string name,
DateTime dateOfJoining)
{
Id = Guid.NewGuid();
Name = name;
DateOfJoining = dateOfJoining;
}
public Guid Id { get; }
public string Name { get; }
public DateTime DateOfJoining { get; }
public Address? HomeAddress { get; set; }
}
[GenerateMappedDto]
public class Address
{
public Address(
string streetName,
int houseNumber,
string postCode)
{
StreetName = streetName;
HouseNumber = houseNumber;
PostCode = postCode;
}
public string StreetName { get; }
public int HouseNumber { get; }
public string PostCode { get; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment