public EntitiesProfile() { this.CreateMap <Entity, EntityResponse>(); this.CreateMap <CreateEntityCommand, Entity>() .ForMember(dest => dest.Id, opt => opt.MapFrom(command => ObjectIdentifier.GenerateNewId())); this.CreateMap <UpdateEntityCommand, Entity>() .ForMember(dest => dest.Id, opt => opt.MapFrom(command => ObjectIdentifierParser.ValidateAndParse(command.Id))); }