You can change the default formvalue limit using the FormOptions . If you are using MVC, then you can create a filter and decorate on action where you want to extend this limit and keep the default for rest of the actions. namespace Filter { using System; using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Mvc.Filters; /// <summary> /// Request Form Size Limit Attribute /// </summary> /// <seealso cref="System.Attribute" /> /// <seealso cref="Microsoft.AspNetCore.Mvc.Filters.IAuthorizationFilter" /> /// <seealso cref="Microsoft.AspNetCore.Mvc.Filters.IOrderedFilter" /> [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)] public class RequestFormSizeLimitAttribute : Attribute, IAuthorizationFilter { /// <summary> /// The form options /// </summary> private read
What is the Repository Design Pattern in C#? The Repository Design Pattern in C# Mediates between the domain and the data mapping layers using a collection-like interface for accessing the domain objects. In other words, we can say that a Repository Design Patternacts as a middleman or middle layer between the rest of the application and the data access logic. That means a repository pattern isolates all the data access code from the rest of the application. The advantage of doing so is that, if you need to do any change then you need to do in one place. Another benefit is that testing your controllers becomes easy because the testing framework need not run against the actual database access code. With a repository design pattern introduced, the above figure can be changed to: Why we need the Repository Pattern in C#? Most of the data-driven applications need to access the data residing in one or more other data sources. Most of the time data sources will be a database. Again, the
I need a financial / calendar year based on current or today's date time We need some time dynamically financial year or calendar year base on current date. Suppose any company or organization have calendar year like 1 st Jan to 31 th Dec, 1 st Feb to 31 th Jan, 1 st Apr to 31 Mar, 1 st Oct to 31 th Sep etc...… So we need calculate current calendar year base on calendar start month of organization /company. Examples Suppose Today's date is 5 th Feb 2017 and organization calendar start month is Jan(01) then current calendar year we will be 1 st Jan 2017 to 31 th Dec 2017. Suppose Today's date is 10 th Mar 2017 and organization calendar start month is Apr(04) then current calendar year we will be 1 st Apr 2016 to 31 th Mar 2017. Suppose Today's date is 10 th May 2018 and organization calendar start month is Apr(04) then current calendar year we will be 1 s t Apr 2018 to 31 th Mar 2019. public static DateTime GetCurrentCalendarStartDate(
Comments
Post a Comment