Skip to content

Instantly share code, notes, and snippets.

@danielpetisme
Created June 11, 2019 19:53
Show Gist options
  • Save danielpetisme/c9fa9087655d352b5a4d594bb228e948 to your computer and use it in GitHub Desktop.
Save danielpetisme/c9fa9087655d352b5a4d594bb228e948 to your computer and use it in GitHub Desktop.
.Net Data Objects
using System;
using System.Collections.Generic;
using System.Linq;
public class UserDTO {
public string Id { get; set; }
public string Login { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string Email { get; set; }
public string ImageUrl { get; set; }
public bool Activated { get; set; }
public string LangKey { get; set; }
public ISet<string> Roles { get; set; }
}
public class Program
{
public static void Main()
{
var userDto = new UserDTO {
Login = "johwick",
FirstName = "John",
LastName = "Wick",
Email = "john@iluvmydog.com",
Activated = false,
ImageUrl = "http://placehold.it/50x50",
LangKey = "en",
Roles = new HashSet<string> {
"ROLE_USER"
}
};
Console.WriteLine(userDto.FirstName);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment