For those like me that went the MSSQL route on the CommandsService Project instead of keeping it in memory, you will most likely run into an issue with inserting a platform in the EventProcessor that does not happen when using in memory.
The mapping used for PlatformPublishedDto
CreateMap<PlatformPublishedDto, Platform>()
.ForMember(dest => dest.ExternalId, opt => opt.MapFrom(src => src.Id));
while mapping the PlatformService's PlatformPublishedDto.Id to a CommandsService's PlatformPublishedDto.ExternalId , it will leave the same PlatformService's PlatformPublishedDto.Id also mapped to the CommandsService's PlatformPublishedDto.Id
That will cause MSSQL to complain about inserting with an explicit IDENTITY.
To fix this, you have to tell AutoMapper to ignore Id on the destination like below:
CreateMap<PlatformPublishedDto, Platform>()
.ForMember(dest => dest.ExternalId, opt => opt.MapFrom(src => src.Id))
.ForMember(dest => dest.Id, opt => opt.Ignore());
For those like me that went the MSSQL route on the CommandsService Project instead of keeping it in memory, you will most likely run into an issue with inserting a platform in the EventProcessor that does not happen when using in memory.
The mapping used for PlatformPublishedDto
while mapping the PlatformService's
PlatformPublishedDto.Idto a CommandsService'sPlatformPublishedDto.ExternalId, it will leave the same PlatformService'sPlatformPublishedDto.Idalso mapped to the CommandsService'sPlatformPublishedDto.IdThat will cause MSSQL to complain about inserting with an explicit IDENTITY.
To fix this, you have to tell AutoMapper to ignore
Idon the destination like below: