public IVoluntario GetVoluntarioById(string Id)
        {
            IVoluntario ret = null;

            using (var tracer = new CrossCutting.IoCManager.CentralTrace.Business.Publisher.CentralTracerBusinessIoCManager(_conf).GetITraceBusinessCurrentImplementation(RequestId))
            {
                Expression <Func <IVoluntario, bool> > filter = x => x.Id.Equals(Id);
                ret = base.Context.VoluntarioCollection.Find(filter).First();
            }
            return(ret);
        }
        /// <summary>
        /// TODO - pagnination
        /// </summary>
        /// <param name="currentPage"></param>
        /// <returns></returns>
        public IList <IVoluntario> GetListVoluntario(int currentPage)
        {
            IList <IVoluntario> ret = null;

            using (var tracer = new CrossCutting.IoCManager.CentralTrace.Business.Publisher.CentralTracerBusinessIoCManager(_conf).GetITraceBusinessCurrentImplementation(RequestId))
            {
                base.Context.VoluntarioCollection.EnsureIndex(x => x.Nome);
                ret = base.Context.VoluntarioCollection.Query()
                      .ToList();
            }
            return(ret);
        }
        public IVoluntario GetVoluntarioById(string Id)
        {
            IVoluntario vol = null;

            using (var tracer = new CrossCutting.IoCManager.CentralTrace.Business.Publisher.CentralTracerBusinessIoCManager(_conf).GetITraceBusinessCurrentImplementation(RequestId))
            {
                base.Context.VoluntarioCollection.EnsureIndex(x => x.Id);
                vol = base.Context.VoluntarioCollection.Query()
                      .Where(c => c.Id == Id)
                      .FirstOrDefault();
            }
            return(vol);
        }
        public bool EmailLogIn(string email, string pass)
        {
            bool ret = false;

            using (var tracer = new CrossCutting.IoCManager.CentralTrace.Business.Publisher.CentralTracerBusinessIoCManager(_conf).GetITraceBusinessCurrentImplementation(RequestId))
            {
                base.Context.VoluntarioCollection.EnsureIndex(x => x.Email);
                ret = (base.Context.VoluntarioCollection.Query()
                       .Where(c => c.Email == email && c.Senha == pass)
                       .FirstOrDefault()) != null;
            }
            return(ret);
        }
        //TODO PAGINATION
        public IList <IVoluntario> GetListVoluntario(int currentPage)
        {
            IList <IVoluntario> ret = null;

            using (var tracer = new CrossCutting.IoCManager.CentralTrace.Business.Publisher.CentralTracerBusinessIoCManager(_conf).GetITraceBusinessCurrentImplementation(RequestId))
            {
                IMongoQueryable <IVoluntario> query = base.Context.VoluntarioCollection.AsQueryable();
                //.OrderBy(x => x.Nome);

                ret = query.ToList();
            }
            return(ret);
        }
        public void TestTracerInjectionNoParameters()
        {
            ITracerWrapper obj;

            try
            {
                obj = new CrossCutting.IoCManager.CentralTrace.Business.Publisher.CentralTracerBusinessIoCManager(base.Config).GetITraceBusinessCurrentImplementation(Guid.NewGuid().ToString());
            }
            catch (Exception ex)
            {
                throw ex;
            }
            Assert.IsTrue(obj != null && obj.GetType().IsClass);
        }
        public IList <IVoluntario> GetVoluntarioByName(string name)
        {
            IList <IVoluntario> ret = null;

            using (var tracer = new CrossCutting.IoCManager.CentralTrace.Business.Publisher.CentralTracerBusinessIoCManager(_conf).GetITraceBusinessCurrentImplementation(RequestId))
            {
                base.Context.VoluntarioCollection.EnsureIndex(x => x.Nome);
                ret = base.Context.VoluntarioCollection.Query()
                      .Where(x => x.Nome.ToUpper().Contains(name.ToUpper()))
                      .OrderBy(x => x.Nome)
                      .Limit(100)
                      .ToList();
            }
            return(ret);
        }