private void MapViewModelsToCommands() { this.CreateMap <AddLocationViewModel, AddLocationCommand>() .ConstructUsing(source => new AddLocationCommand(LocationId.NewComb(), source.Name, source.Address, new Latitude(source.Latitude), new Longitude(source.Longitude), source.PricePerKw)); this.CreateMap <EditLocationViewModel, EditLocationCommand>() .ConstructUsing(source => new EditLocationCommand(LocationId.With(Guid.Parse(source.Id)), source.Name, source.Address, new Latitude(source.Latitude), new Longitude(source.Longitude), source.PricePerKw)); this.CreateMap <DeleteLocationViewModel, DeleteLocationCommand>() .ConstructUsing(source => new DeleteLocationCommand(LocationId.With(Guid.Parse(source.Id)))); }