Skip to content

Instantly share code, notes, and snippets.

@ilyapalkin
ilyapalkin / IMapper.cs
Last active January 25, 2024 17:13
An abstraction over AutoMapper to map several sources into single destination.
/// <summary>
/// Type mapping api
/// </summary>
public interface IMapper
{
/// <summary>
/// Maps the specified source type instance to destination type instance.
/// </summary>
/// <typeparam name="TSource">Source type.</typeparam>
/// <typeparam name="TDestination">Destination type.</typeparam>
@ilyapalkin
ilyapalkin / Entity.cs
Last active August 29, 2015 13:55
Setting the identity of a Domain Entity
public class Entity
{
private int? id;
public int Id
{
get
{
return id.Value;
}