public static ClinicalProductCategoryDto ToDto(this ClinicalProductCategory cItem) { var dto = new ClinicalProductCategoryDto { ClinicalCategoryId = cItem.ClinicalCategoryId, ProductCategoryId = cItem.ProductCategoryId, StartDate = cItem.StartDate, EndDate = cItem.EndDate }; ((IData)cItem).ToDto((IDataDto)dto); return(dto); }
public static ClinicalProductCategory ToDomain(this ClinicalProductCategoryDto cItem, ClinicalProductCategory originalCItem = null) { if (originalCItem != null && originalCItem.Id == cItem.Id) { originalCItem.ClinicalCategoryId = cItem.ClinicalCategoryId; originalCItem.ProductCategoryId = cItem.ProductCategoryId; originalCItem.StartDate = cItem.StartDate; originalCItem.EndDate = cItem.EndDate; ((IDataDto)cItem).ToDomain((IData)originalCItem); return(originalCItem); } var data = new ClinicalProductCategory { ClinicalCategoryId = cItem.ClinicalCategoryId, ProductCategoryId = cItem.ProductCategoryId, StartDate = cItem.StartDate, EndDate = cItem.EndDate }; ((IDataDto)cItem).ToDomain((IData)data); return(data); }