public AnyServiceConfig() { MaxMultipartBoundaryLength = 50; ErrorEventKey = LoggingEvents.UnexpectedException.Name; MaxValueCount = 25; DefaultPaginationSettings = new PaginationSettings { DefaultOrderBy = nameof(IEntity.Id), DefaultOffset = 0, DefaultPageSize = 50, DefaultSortOrder = PaginationSettings.Asc, }; FilterFactoryType = typeof(DefaultFilterFactory); ModelPrepararType = typeof(DummyModelPreparar <>); ServiceResponseMapperType = typeof(DataOnlyServiceResponseMapper); AuditSettings = new AuditSettings { AuditRules = new AuditRules { AuditCreate = true, AuditRead = true, AuditUpdate = true, AuditDelete = true, } }; UseLogRecordEndpoint = true; UseErrorEndpointForExceptionHandling = true; MapperName = "default"; }
public UserManager( IUserRepository userRepository, IConfirmationService confirmationService, PaginationSettings paginationSettings, IProjectMembershipRepostiory projectMembershipRepostiory, IMailer mailer, ApplicationLocationSettings applicationLocationSettings, IPasswordManager passwordManager, IEventBus eventBus) { Require.NotNull(userRepository, nameof(userRepository)); Require.NotNull(confirmationService, nameof(confirmationService)); Require.NotNull(paginationSettings, nameof(paginationSettings)); Require.NotNull(projectMembershipRepostiory, nameof(projectMembershipRepostiory)); Require.NotNull(mailer, nameof(mailer)); Require.NotNull(applicationLocationSettings, nameof(applicationLocationSettings)); Require.NotNull(passwordManager, nameof(passwordManager)); Require.NotNull(eventBus, nameof(eventBus)); _userRepository = userRepository; _confirmationService = confirmationService; _paginationSettings = paginationSettings; _projectMembershipRepostiory = projectMembershipRepostiory; _mailer = mailer; _applicationLocationSettings = applicationLocationSettings; _passwordManager = passwordManager; _eventBus = eventBus; }
static void Main(string[] args) { Faker.PopularBase(); var ctx = new Context(); var t1 = ctx.TipoParte.ToList(); var t2 = ctx.ClasseTipoParte.ToList(); var filter = PredicateBuilder.True <ClasseTipoParte>(); filter = filter.And(x => x.ExisteVinculo == true); //filter = filter.And(x => x.CodigoClasse == 1); var exp = filter.Compile(); var pageSettings = new PaginationSettings(); pageSettings.SortSettings.OrderBy = "CodigoClasse"; var result = (from classes in ctx.ClasseTipoParte join tipoparte in ctx.TipoParte on 1 equals 1 into Details from m in Details.DefaultIfEmpty() let tp = m select new ClasseTipoParte { CodigoClasse = classes.CodigoClasse, CodigoTipoParte = m.CodigoTipoParte, Tipo = classes.Tipo, TipoParte = classes.CodigoTipoParte == m.CodigoTipoParte ? tp : null, ExisteVinculo = classes.CodigoTipoParte == m.CodigoTipoParte ? true : false, }).Where(exp).AsQueryable().Page(pageSettings).ToList(); Console.WriteLine("Hello World!"); }
public ProvideQueryBehaviour(RequestProviderItems providerItems, IHttpContextAccessor accessor, SemanticsDefiner semanticsDefiner) { _parameters = providerItems.Parameters; _paginationSettings = providerItems.PaginationSettings; _httpContext = accessor.HttpContext; _querySemantics = semanticsDefiner.GetQuery <TResponse>(); }
public void Can_Build_Correct_Model_For_10_Items_With_2_Item_Per_Page() { // Assemble var expectedPagination = new List <PaginationLink>() { new PaginationLink { Active = true, Text = "«", PageNumber = 2, Url = "/test/2" }, new PaginationLink { Active = true, Text = "1", PageNumber = 1, Url = "/test/1" }, new PaginationLink { Active = true, Text = "2", PageNumber = 2, Url = "/test/2" }, new PaginationLink { Active = true, Text = "3", PageNumber = 3, Url = "/test/3", IsCurrent = true }, new PaginationLink { Active = true, Text = "4", PageNumber = 4, Url = "/test/4" }, new PaginationLink { Active = true, Text = "5", PageNumber = 5, Url = "/test/5" }, new PaginationLink { Active = true, Text = "»", PageNumber = 4, Url = "/test/4" } }; var settings = new PaginationSettings { CurrentPage = 3, ItemsPerPage = 2, TotalItems = 10 }; var builder = new PaginationLinkBuilder(); //Act var result = builder.BuildPaginationLinks( settings, generateUrl, firstPageText, firstPageTitle, previousPageText, previousPageTitle, nextPageText, nextPageTitle, lastPageText, lastPageTitle, spacerText); //Assert Assert.Equal(expectedPagination.Count, result.Count); PaginationComparer comparer = new PaginationComparer(); for (int i = 0; i < expectedPagination.Count; i++) { Assert.Equal(expectedPagination[i], result[i], comparer); } }
public BlogViewModel(IContentProcessor contentProcessor) { _contentProcessor = contentProcessor; ProjectSettings = new ProjectSettings(); Paging = new PaginationSettings(); Categories = new Dictionary <string, int>(); Archives = new Dictionary <string, int>(); BlogRoutes = new DefaultBlogRoutes(); }
public BlogViewModel(IHtmlProcessor htmlProcessor) { ProjectSettings = new ProjectSettings(); Paging = new PaginationSettings(); Categories = new Dictionary <string, int>(); Archives = new Dictionary <string, int>(); filter = htmlProcessor; BlogRoutes = new DefaultBlogRoutes(); }
public CategoryController(ICategoryService service, IMapper mapper, IHostingEnvironment environment, IOptions <PaginationSettings> settings) { this.mapper = mapper; this.service = service; this.environment = environment; this.settings = settings.Value; }
public ImageController( IOptions <PaginationSettings> settings, IHostingEnvironment environment, IMapper mapper, IImageService service) { this.settings = settings.Value; this.environment = environment; this.mapper = mapper; this.service = service; }
public BlogViewModel() { ProjectSettings = new ProjectSettings(); Paging = new PaginationSettings(); Categories = new Dictionary <string, int>(); Archives = new Dictionary <string, int>(); filter = new HtmlProcessor(); cryptoHelper = new CryptoHelper(); EditorSettings = new EditorModel(); BlogRoutes = new DefaultBlogRoutes(); }
/// <summary> /// Create a Matching UI session to search for resumes or jobs that meet specific criteria /// </summary> /// <param name="sovClient">The SovrenClient</param> /// <param name="indexesToQuery">The indexes to find results in. These must all be of the same type (resumes or jobs)</param> /// <param name="query">The search query. A result must satisfy all of these criteria</param> /// <param name="settings">The settings for this search request</param> /// <param name="pagination">Pagination settings. If not specified the default will be used</param> /// <exception cref="SovrenException">Thrown when an API error occurs</exception> public static async Task <GenerateUIResponse> Search( this SovrenClientWithUI sovClient, IEnumerable <string> indexesToQuery, FilterCriteria query, SearchMatchSettings settings = null, PaginationSettings pagination = null) { SearchRequest request = sovClient.InternalClient.CreateRequest(indexesToQuery, query, settings, pagination); UISearchRequest uiRequest = new UISearchRequest(request, sovClient.UISessionOptions); return(await sovClient.InternalClient.UISearch(uiRequest)); }
public PaginationQuery(IPaginateable pagination, PaginationSettings settings) { PageNumber = pagination?.PageNumber < 1 ? _defaultPageNumber : pagination.PageNumber; PageSize = pagination.PageSize <1 ? settings.DefaultPageSize : pagination.PageSize> settings.MaxPageSize ? settings.MaxPageSize : pagination.PageSize; IsApplied = !(pagination.PageSize < 1 && pagination.PageNumber < 1); }
protected string GetPaginationCommand(string command, PaginationSettings paginationSettings) { if (!string.IsNullOrEmpty(paginationSettings.Where)) { command += $" WHERE {paginationSettings.Where}"; } command += $" ORDER BY {paginationSettings.OrderColumn.FullName}"; if (paginationSettings.OrderColumn.IsDesc) { command += $" DESC"; } command += $" LIMIT {paginationSettings.Limit} OFFSET {paginationSettings.Offset}"; return(command); }
public ProjectProvider( IProjectManagerGateway projectManagerGateway, IVersionControlSystemGateway versionControlSystemGateway, IProjectRepository projectRepository, IEventSink eventSink, IUserRepository userRepository, PaginationSettings paginationSettings, IssuePaginationSettings issuePaginationSettings) { Require.NotNull(projectManagerGateway, nameof(projectManagerGateway)); Require.NotNull(versionControlSystemGateway, nameof(versionControlSystemGateway)); Require.NotNull(projectRepository, nameof(projectRepository)); Require.NotNull(eventSink, nameof(eventSink)); Require.NotNull(userRepository, nameof(userRepository)); Require.NotNull(paginationSettings, nameof(paginationSettings)); _projectManagerGateway = projectManagerGateway; _versionControlSystemGateway = versionControlSystemGateway; _projectRepository = projectRepository; _eventSink = eventSink; _userRepository = userRepository; _paginationSettings = paginationSettings; _issuePaginationSettings = issuePaginationSettings; }
protected string GetPaginationByLastIdCommand(string command, string fromTableName, Guid?id, PaginationSettings paginationSettings) { if (id.HasValue) { command += $" WHERE (({paginationSettings.OrderColumn.FullName}) "; if (paginationSettings.OrderColumn.IsDesc) { command += "<"; } else { command += ">"; } command += $" (SELECT ({paginationSettings.OrderColumn.FullName}) FROM {fromTableName} WHERE id='{id}'))"; if (!string.IsNullOrEmpty(paginationSettings.Where)) { command += $" AND ({paginationSettings.Where})"; } } else { if (!string.IsNullOrEmpty(paginationSettings.Where)) { command += $" WHERE {paginationSettings.Where}"; } } command += $" ORDER BY {paginationSettings.OrderColumn.FullName}"; if (paginationSettings.OrderColumn.IsDesc) { command += $" DESC"; } command += $" LIMIT {paginationSettings.Limit}"; return(command); }
public PagedContentListViewModel() { Paging = new PaginationSettings(); }
public ProductPagingViewModel() { Paging = new PaginationSettings(); }
protected override void Render(Microsoft.ReportingServices.OnDemandReportRendering.Report report, NameValueCollection deviceInfo, Hashtable renderProperties, CreateAndRegisterStream createAndRegisterStream) { PaginationSettings paginationSettings = new PaginationSettings(report, deviceInfo); paginationSettings.UseEmSquare = true; paginationSettings.MeasureTextDpi = 1000; paginationSettings.UseGenericDefault = false; if (paginationSettings.DynamicImageDpiX == 96) { paginationSettings.DynamicImageDpiX = 300; } if (paginationSettings.DynamicImageDpiY == 96) { paginationSettings.DynamicImageDpiY = 300; } BufferedStream bufferedStream; using (Microsoft.ReportingServices.Rendering.HPBProcessing.HPBProcessing hPBProcessing = new Microsoft.ReportingServices.Rendering.HPBProcessing.HPBProcessing(report, paginationSettings, createAndRegisterStream, ref renderProperties)) { hPBProcessing.SetContext(hPBProcessing.PaginationSettings.StartPage, hPBProcessing.PaginationSettings.EndPage); using (Renderer renderer = new Renderer(physicalPagination: true)) { bufferedStream = new BufferedStream(createAndRegisterStream(report.Name, "pdf", null, "application/pdf", willSeek: false, StreamOper.CreateAndRegister)); using (PDFWriter pDFWriter = new PDFWriter(renderer, bufferedStream, disposeRenderer: false, createAndRegisterStream, hPBProcessing.PaginationSettings.DpiX, hPBProcessing.PaginationSettings.DpiY)) { pDFWriter.HumanReadablePDF = m_humanReadablePDF; pDFWriter.PrintOnOpen = m_printOnOpen; pDFWriter.Test = m_test; pDFWriter.EmbedFonts = m_embedFonts; if (report.HasDocumentMap) { DocumentMap documentMap = null; try { documentMap = report.DocumentMap; if (documentMap != null) { if (documentMap.MoveNext()) { DocumentMapNode current = documentMap.Current; HandleDocumentMap(documentMap, pDFWriter.DocumentMapRootLabel = new PDFLabel(current.Id, current.Label), 1); } if (pDFWriter.DocumentMapRootLabel.Children == null || pDFWriter.DocumentMapRootLabel.Children.Count == 0) { pDFWriter.DocumentMapRootLabel = null; } else { pDFWriter.DocumentMapLabelPoints = new Dictionary <string, PDFPagePoint>(); } } } finally { documentMap?.Dispose(); } } int num = hPBProcessing.PaginationSettings.StartPage; pDFWriter.BeginReport(hPBProcessing.PaginationSettings.MeasureTextDpi, hPBProcessing.PaginationSettings.MeasureTextDpi); while (true) { hPBProcessing.GetNextPage(out RPLReport rplReport); if (rplReport == null) { break; } renderer.ProcessPage(rplReport, num, hPBProcessing.SharedFontCache, hPBProcessing.GlyphCache); rplReport.Release(); rplReport = null; num++; } pDFWriter.EndReport(); } } } bufferedStream.Flush(); }
public RoleListViewModel() { SiteRoles = new List <ISiteRole>(); Paging = new PaginationSettings(); }
public PagedAdminCategoryViewModel() { Paging = new PaginationSettings(); }
public PagedAdminContactUsViewModel() { Paging = new PaginationSettings(); }
public PagedAppLogItemsDto() { Paging = new PaginationSettings(); }
public UserListViewModel() { UserList = new List <IUserInfo>(); Paging = new PaginationSettings(); }
protected IEnumerable <TModel> GetPaginationDefaultCommand(PaginationSettings paginationSettings) { return(GetPagination(GetSelectAllCommand(), paginationSettings)); }
public PagedUsersListViewModel() { Paging = new PaginationSettings(); }
protected IEnumerable <TModel> GetPagination(string command, PaginationSettings paginationSettings) { return(RunCommand(GetPaginationCommand(command, paginationSettings)).Select(MapToModel)); }
public PagedAdminSlideShowViewModel() { Paging = new PaginationSettings(); }
public PagedAppLogItemsViewModel() { Paging = new PaginationSettings(); }
public PagedCategoryCommentViewModel() { Paging = new PaginationSettings(); }
public PagedNotificationViewModel() { Paging = new PaginationSettings(); }
public ScopeListViewModel() { Scopes = new List <Scope>(); Paging = new PaginationSettings(); }