private LocalAuthorityRatesGroupsBase EntityResolver(
            string partitionKey,
            string rowKey,
            DateTimeOffset timestamp,
            IDictionary <string, EntityProperty> properties,
            string etag)
        {
            LocalAuthorityRatesGroupsBase toReturn = null;

            Type baseType = typeof(LocalAuthorityRatesGroupsBase);

            string baseTypeNamespace = baseType.Namespace;

            // rowKey is the entity type.
            string typeName = $"{baseTypeNamespace}.{rowKey}";

            Type type = Type.GetType(typeName);

            toReturn = (LocalAuthorityRatesGroupsBase)Activator.CreateInstance(type);

            toReturn.PartitionKey = partitionKey;
            toReturn.RowKey       = rowKey;
            toReturn.Timestamp    = timestamp;
            toReturn.ETag         = etag;

            toReturn.ReadEntity(properties, null);

            return(toReturn);
        }
        private TModelsBase ExtractAndMap <TModelsBase, TSchoolRatesGroupsBase>(
            IList <LocalAuthorityRatesGroupsBase> localAuthorityRatesGroupsBases)
            where TSchoolRatesGroupsBase : LocalAuthorityRatesGroupsBase
            where TModelsBase : DomainModels.ModelsBase
        {
            TModelsBase toReturn = null;

            LocalAuthorityRatesGroupsBase localAuthorityRatesGroupsBase =
                localAuthorityRatesGroupsBases.SingleOrDefault(x => x is TSchoolRatesGroupsBase);

            if (localAuthorityRatesGroupsBase != null)
            {
                TSchoolRatesGroupsBase schoolRatesGroupsBaseTyped =
                    localAuthorityRatesGroupsBase as TSchoolRatesGroupsBase;

                toReturn = this.mapper.Map <TSchoolRatesGroupsBase, TModelsBase>(
                    schoolRatesGroupsBaseTyped);
            }

            return(toReturn);
        }