private static ProductAzureTableEntity MapDtoToEntity(ProductDto dto, ProductAzureTableEntity entity = null) { entity = entity ?? new ProductAzureTableEntity(); entity.PartitionKey = dto.PartitionKey; entity.RowKey = dto.Id.ToStringId(); entity.ProductName = dto.ProductName; entity.ProductDescription = dto.ProductDescription; return(entity); }
private static ProductDto MapEntityToDto(ProductAzureTableEntity entity, ProductDto dto = null) { dto = dto ?? new ProductDto(); dto.PartitionKey = entity.PartitionKey; dto.Id = entity.RowKey.ToGuidId().Value; dto.ProductName = entity.ProductName; dto.ProductDescription = entity.ProductDescription; return(dto); }