/// <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); } }
// ----------------------------------------------------------------------------- async Task PrepareAsync() { ServicesRepo.AddService(_serviceProvider.GetService <IHousemaidWorker>()); //PrepareADXConsumer(subscription); _ready = true; await Task.Yield(); GoGoGo(); }
/// <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); } }
/// <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); } }
/// <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); } }
/// <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); } }
// ----------------------------------------------------------------------------- void GoGoGo() { ServicesRepo.StartAllServices(); }