Skip to content

Instantly share code, notes, and snippets.

View maiconheck's full-sized avatar

Maicon Heck maiconheck

View GitHub Profile
public class Name
{
public Name(string firstName, string lastName = "")
{
Guard.Against.NullOrWhiteSpace(firstName, nameof(firstName));
FirstName = firstName;
LastName = lastName;
}
@maiconheck
maiconheck / Lead.cs
Last active June 20, 2023 13:45
[3º Improvement]
public class Lead
{
public Lead(string name, string email)
{
Name = name;
Email = email;
_segments = new List<Segment>();
}
public string Name { get; }
@maiconheck
maiconheck / Lead.cs
Last active June 20, 2023 12:34
[2º improvement] An anemic entity sample for blog posting.
public class Lead
{
// Initializing Segments to avoid an exception.
public Lead(string name, string email)
{
Name = name;
Email = email;
_segments = new List<Segment>();
}
@maiconheck
maiconheck / Lead.cs
Last active June 20, 2023 12:24
[1º improvement] An anemic entity sample for blog posting.
public class Lead
{
// The minimum data needed to create a Lead instance.
// The name and e-mail are the minimum necessary for a Lead to exist. Remember?
public Lead(string name, string email)
{
Name = name;
Email = email;
}
@maiconheck
maiconheck / Lead.cs
Last active June 26, 2021 13:38
Capturar Leads Context
using System;
using System.Collections.Generic;
using System.Linq;
namespace DddBuildingBlocks.Domain.CapturarLeadsContext
{
public class Lead : Entity
{
private readonly List<Segment> _segments = new List<Segment>();
@maiconheck
maiconheck / Lead.cs
Last active February 3, 2021 11:47
An anemic entity sample for blog posting.
public class Lead
{
public string Name { get; set; }
public string Email { get; set; }
public IList<Segment> Segments { get; set; }
public string Company { get; set; }
@maiconheck
maiconheck / VS-Shortcuts-CheatSheet.md
Last active October 17, 2020 09:48
VS Shortcuts CheatSheet

My Visual Studio Shortcuts CheatSheet

The frequently used / custom shortcuts


Edit / File

Code Cleanup Format Document Insert Snippet Surround With
Ctrl+K, Ctrl+E Ctrl+K, Ctrl+D Ctrl+K, Ctrl+X Ctrl+K, Ctrl+S