public async Task <int> CountAsync(Expression <Func <T, bool> > predicate, Guid identityWorkId)
 {
     using var context     = new CotorraGeneralContext(ConnectionManager.ConfigConnectionStringGeneral);
     using var iRepository = new RepositoryStorage <T, CotorraGeneralContext>(context, true);
     return(await iRepository.GetCountAsync(predicate, identityWorkID : identityWorkId));
 }
 /// <summary>
 /// Delete things
 /// </summary>
 /// <param name="lstObjects"></param>
 /// <param name="identityWorkId"></param>
 public void Delete(List <Guid> lstObjects, Guid identityWorkId)
 {
     using var context     = new CotorraGeneralContext(ConnectionManager.ConfigConnectionStringGeneral);
     using var iRepository = new RepositoryStorage <T, CotorraGeneralContext>(context, true);
     iRepository.Delete(lstObjects, identityWorkId);
 }
 public async Task CreateorUpdateAsync(List <T> objectsToCreate, Guid identityWorkID)
 {
     using var context     = new CotorraGeneralContext(ConnectionManager.ConfigConnectionStringGeneral);
     using var iRepository = new RepositoryStorage <T, CotorraGeneralContext>(context, true);
     await iRepository.CreateorUpdateAsync(objectsToCreate, identityWorkID);
 }
 public int Count(string predicate, Guid identityWorkId)
 {
     using var context     = new CotorraGeneralContext(ConnectionManager.ConfigConnectionStringGeneral);
     using var iRepository = new RepositoryStorage <T, CotorraGeneralContext>(context, true);
     return(iRepository.GetCount(predicate, identityWorkID: identityWorkId));
 }
 public async Task UpdateAsync(List <T> lstObjects, Guid identityWorkId)
 {
     using var context     = new CotorraGeneralContext(ConnectionManager.ConfigConnectionStringGeneral);
     using var iRepository = new RepositoryStorage <T, CotorraGeneralContext>(context, true);
     await iRepository.UpdateAsync(lstObjects, identityWorkId);
 }
 public List <T> GetAll(Guid identityWorkId, string[] objectsToInclude)
 {
     using var context     = new CotorraGeneralContext(ConnectionManager.ConfigConnectionStringGeneral);
     using var iRepository = new RepositoryStorage <T, CotorraGeneralContext>(context, true);
     return(iRepository.FindAll(identityWorkID: identityWorkId).ToList());
 }
 public async Task <List <T> > FindAsync(string predicate, Guid identityWorkId, string[] objectsToInclude)
 {
     using var context     = new CotorraGeneralContext(ConnectionManager.ConfigConnectionStringGeneral);
     using var iRepository = new RepositoryStorage <T, CotorraGeneralContext>(context, true);
     return(await iRepository.FindAsync(predicate, identityWorkID : identityWorkId, objectsToInclude : objectsToInclude));
 }
 /// <summary>
 /// To find a predicate indicated in the method
 /// </summary>
 /// <param name="predicate"></param>
 /// <param name="identityWorkId"></param>
 /// <returns></returns>
 public List <T> Find(Expression <Func <T, bool> > predicate, Guid identityWorkId, string[] objectsToInclude)
 {
     using var context     = new CotorraGeneralContext(ConnectionManager.ConfigConnectionStringGeneral);
     using var iRepository = new RepositoryStorage <T, CotorraGeneralContext>(context, true);
     return(iRepository.Find(predicate, identityWorkID: identityWorkId, objectsToInclude: objectsToInclude).ToList());
 }
 public async Task <List <T> > GetByIdsAsync(List <Guid> lstGuids, Guid identityWorkId, string[] objectsToInclude)
 {
     using var context     = new CotorraGeneralContext(ConnectionManager.ConfigConnectionStringGeneral);
     using var iRepository = new RepositoryStorage <T, CotorraGeneralContext>(context, true);
     return((await iRepository.GetByIdsAsync(lstGuids, identityWorkID: identityWorkId, objectsToInclude: objectsToInclude)).Select(p => p.Value).ToList());
 }