/// <summary>
        /// Retrieve the model associated with the id.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static BoolResult <T> Get(int id)
        {
            IEntityService <T> service = ActiveRecordRegistration.GetService <T>();
            IActionContext     context = ActiveRecordRegistration.GetContext <T>();

            context.Id = id;
            BoolResult <T> result = service.Get(context);

            ActiveRecordRegistration.Init <T>(result.Item, service);
            return(result);
        }
        /// <summary>
        /// Retrieve all instances of model.
        /// </summary>
        /// <returns></returns>
        public static BoolResult <IList <T> > GetAll()
        {
            IEntityService <T>      service = ActiveRecordRegistration.GetService <T>();
            IActionContext          ctx     = ActiveRecordRegistration.GetContext <T>();
            BoolResult <IList <T> > result  = service.GetAll(ctx);

            foreach (T item in result.Item)
            {
                ActiveRecordRegistration.Init <T>(item, service);
            }
            return(result);
        }