public static ProviderSubTypeDTO ToProviderSubTypeDTO(ProviderSubType data) { return(new ProviderSubTypeDTO { Id = data.ID, ProviderTypeId = data.ParentTypeID, Code = data.Code, Name = data.Name }); }
public InsertSaveOperationResult InsertProviderSubType(ProviderSubTypeDTO providerSubType) { var providerSubTypeDb = new ProviderSubType() { ParentTypeID = providerSubType.ProviderTypeId }; Mapper.Map(providerSubType, providerSubTypeDb); Context.ProviderSubTypes.Add(providerSubTypeDb); Context.SaveChanges(); return(new InsertSaveOperationResult { Success = true, Data = Mapper.ToProviderSubTypeDTO(providerSubTypeDb) }); }
public static void Map(ProviderSubTypeDTO providerSubType, ProviderSubType providerSubTypeDb) { providerSubTypeDb.Code = providerSubType.Code; providerSubTypeDb.Name = providerSubType.Name; }