Example #1
0
        private static string InitializeEntityName(RegisteredInterfaceImplementations registeredInterfaceImplementations)
        {
            if (typeof(TEntityInterface).IsInterface)
            {
                return(registeredInterfaceImplementations.GetValue(typeof(TEntityInterface),
                                                                   "There is no registered implementation of " + typeof(TEntityInterface).FullName + " in domain object model."
                                                                   + " Try using " + new RegisteredInterfaceImplementationHelperInfo().GetKeyword() + " DSL concept."));
            }

            string fullName = typeof(TEntityInterface).FullName;

            const string queryablePrefix = "Common.Queryable.";

            if (fullName.StartsWith(queryablePrefix))
            {
                int separator = fullName.IndexOf('_');
                if (separator < 0)
                {
                    throw new FrameworkException("Unexpected queryable type \"" + fullName + "\".");
                }
                string module        = fullName.Substring(queryablePrefix.Length, separator - queryablePrefix.Length);
                string dataStructure = fullName.Substring(separator + 1);
                return(module + "." + dataStructure);
            }

            return(fullName);
        }
Example #2
0
 public GenericRepositories(GenericRepositoryParameters parameters, RegisteredInterfaceImplementations registeredInterfaceImplementations)
 {
     _parameters = parameters;
     _registeredInterfaceImplementations = registeredInterfaceImplementations;
 }
Example #3
0
 public GenericRepository(GenericRepositoryParameters parameters, RegisteredInterfaceImplementations registeredInterfaceImplementations)
     : this(parameters, InitializeEntityName(registeredInterfaceImplementations))
 {
 }