public static void Validate <T>(IItemSchemeObject <T> maintainable, IEnumerable <long> codeIds) where T : IItemObject { var insertedCount = codeIds.Count(); var toBeInserted = maintainable.Items.Count; if (insertedCount < toBeInserted) { _log.ErrorFormat("Tried to import a codelist but not all codes were imported into the Mapping Store. Excepted : {0}, Actual: {1}.", toBeInserted, insertedCount); Debug.Assert(insertedCount < toBeInserted, "Tried to import a codelist but not all codes were imported into the Mapping Store"); } }
/// <summary> /// Make a shallow copy of the specified <c>ItemSchemeBean</c> to avoid changing the original item list /// </summary> /// <param name="from"> /// The source <see cref="ItemSchemeBean"/> /// </param> /// <returns> /// The output <see cref="ItemSchemeBean"/> /// </returns> private static T CopyItemScheme(IItemSchemeObject <TI> from) { return((T)from.MutableInstance.ImmutableInstance); }
/// <summary> /// Create a key for the <paramref name="item"/> that belongs to <paramref name="itemScheme"/> /// </summary> /// <param name="item"> /// The <see cref="ItemBean"/> /// </param> /// <param name="itemScheme"> /// The <see cref="ItemSchemeBean"/> /// </param> /// <returns> /// A string that uniquely identifies the <paramref name="item"/> /// </returns> public static string MakeKey(IItemObject item, IItemSchemeObject <IConceptObject> itemScheme) { return(MakeKey(item.Id, itemScheme.Id, itemScheme.AgencyId, itemScheme.Version)); }