コード例 #1
0
 /// <summary>
 /// Obtener cantidad de registros de services
 /// Autor: Jair Guerrero
 /// Fecha: 2021-02-20
 /// </summary>
 public int Count()
 {
     try
     {
         IRepository <Services> repo = new ServicesRepo(context);
         return(repo.Count());
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message, ex.InnerException);
     }
 }
コード例 #2
0
        // -----------------------------------------------------------------------------
        async Task PrepareAsync()
        {
            ServicesRepo.AddService(_serviceProvider.GetService <IHousemaidWorker>());

            //PrepareADXConsumer(subscription);

            _ready = true;

            await Task.Yield();

            GoGoGo();
        }
コード例 #3
0
        /// <summary>
        /// Obtener services por Id
        /// Autor: Jair Guerrero
        /// Fecha: 2021-02-20
        /// </summary>
        public ServicesAM Get(long id)
        {
            try
            {
                IRepository <Services> repo = new ServicesRepo(context);
                var services = repo.Get(id);

                return(mapper.Map <ServicesAM>(services));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex.InnerException);
            }
        }
コード例 #4
0
        /// <summary>
        /// Obtener cantidad de registros de services según filtro
        /// Autor: Jair Guerrero
        /// Fecha: 2021-02-20
        /// </summary>
        public int Count(Expression <Func <ServicesAM, bool> > predicate)
        {
            try
            {
                var where = mapper.MapExpression <Expression <Func <Services, bool> > >(predicate);

                IRepository <Services> repo = new ServicesRepo(context);
                return(repo.Count(where));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex.InnerException);
            }
        }
コード例 #5
0
        /// <summary>
        /// Crear registro de services
        /// Autor: Jair Guerrero
        /// Fecha: 2021-02-20
        /// </summary>
        public long Create(ServicesAM entity)
        {
            try
            {
                var services = mapper.Map <Services>(entity);

                IRepository <Services> repo = new ServicesRepo(context);
                return(repo.Create(services));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex.InnerException);
            }
        }
コード例 #6
0
        /// <summary>
        /// Obtener primera services según filtro
        /// Autor: Jair Guerrero
        /// Fecha: 2021-02-20
        /// </summary>
        public ServicesAM GetFirst(Expression <Func <ServicesAM, bool> > predicate)
        {
            try
            {
                var where = mapper.MapExpression <Expression <Func <Services, bool> > >(predicate);

                IRepository <Services> repo = new ServicesRepo(context);
                var services = repo.GetFirst(where);

                return(mapper.Map <ServicesAM>(services));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex.InnerException);
            }
        }
コード例 #7
0
 // -----------------------------------------------------------------------------
 void GoGoGo()
 {
     ServicesRepo.StartAllServices();
 }