Example #1
0
        public static bool InitialiseProperties <T>(Dependency dependency, List <Property> properties)
        {
            try {
                foreach (var property in properties)
                {
                    dependency.InitialiseProp(property);
                }

                return((bool)Container.GetDependency($"{TypeManipulations.RemoveInterfaceFromName(TypeManipulations.BaseType(typeof(T)).Name)}Services", typeof(T))
                       .InvokeMethod("Add", dependency.ActualObject));
            }
            catch (IndexOutOfRangeException) {
                return(false);
            }
            catch (NullReferenceException) {
                return(true);
            }
        }
Example #2
0
 private static Dependency GetDependency <T>()
 {
     return(Container.GetDependency($"{TypeManipulations.RemoveInterfaceFromName(TypeManipulations.BaseType(typeof(T)).Name)}Services", typeof(T)));
 }