public IDataEntity BuildLARSLearningDeliveryCategories(LARSLearningDeliveryCategory larsLearningDeliveryCategory) { return(new DataEntity(Attributes.EntityLearningDeliveryLARS_Category) { Attributes = new Dictionary <string, IAttributeData>() { { Attributes.LearnDelCatRef, new AttributeData(larsLearningDeliveryCategory.CategoryRef) }, { Attributes.LearnDelCatDateFrom, new AttributeData(larsLearningDeliveryCategory.EffectiveFrom) }, { Attributes.LearnDelCatDateTo, new AttributeData(larsLearningDeliveryCategory.EffectiveTo) }, } }); }
public void BuildLARSLearningDeliveryCategories() { var larsLearningDeliveryCategory = new LARSLearningDeliveryCategory { CategoryRef = 1, EffectiveFrom = new DateTime(2018, 1, 1), EffectiveTo = new DateTime(2019, 1, 1), }; var dataEntity = NewService().BuildLARSLearningDeliveryCategories(larsLearningDeliveryCategory); dataEntity.EntityName.Should().Be("LearningDeliveryLARSCategory"); dataEntity.Attributes.Should().HaveCount(3); dataEntity.Attributes["LearnDelCatRef"].Value.Should().Be(larsLearningDeliveryCategory.CategoryRef); dataEntity.Attributes["LearnDelCatDateFrom"].Value.Should().Be(larsLearningDeliveryCategory.EffectiveFrom); dataEntity.Attributes["LearnDelCatDateTo"].Value.Should().Be(larsLearningDeliveryCategory.EffectiveTo); }
private Data.External.LARS.Model.LARSLearningDeliveryCategory LARSLearningDeliveryCategoryFromEntity(LARSLearningDeliveryCategory entity) { return(new Data.External.LARS.Model.LARSLearningDeliveryCategory() { CategoryRef = entity.CategoryRef, EffectiveFrom = entity.EffectiveFrom, EffectiveTo = entity.EffectiveTo, }); }