示例#1
0
        public virtual ApiBusinessEntityResponseModel MapBOToModel(
            BOBusinessEntity boBusinessEntity)
        {
            var model = new ApiBusinessEntityResponseModel();

            model.SetProperties(boBusinessEntity.BusinessEntityID, boBusinessEntity.ModifiedDate, boBusinessEntity.Rowguid);

            return(model);
        }
        public void MapResponseToRequest()
        {
            var mapper = new ApiBusinessEntityModelMapper();
            var model  = new ApiBusinessEntityResponseModel();

            model.SetProperties(1, DateTime.Parse("1/1/1987 12:00:00 AM"), Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
            ApiBusinessEntityRequestModel response = mapper.MapResponseToRequest(model);

            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Rowguid.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
        }