This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8"?> | |
| <configuration> | |
| <location path="." inheritInChildApplications="false"> | |
| <system.webServer> | |
| <rewrite> | |
| <!--<rules>--> | |
| <!-- Block access to Azure default domain names --> | |
| <!--<rule name="Block Azure Default Domain" stopProcessing="true"> | |
| <match url="(.*)" /> | |
| <conditions> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class ScriptHelper | |
| { | |
| public static void RunScripts(this MigrationBuilder migrationBuilder, string version) | |
| { | |
| var assembly = Assembly.GetExecutingAssembly(); | |
| var resourceNames = assembly.GetManifestResourceNames().Where(str => str.EndsWith(version + ".sql")); | |
| foreach (var resourceName in resourceNames) | |
| { | |
| using (var stream = assembly.GetManifestResourceStream(resourceName)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class ScriptHelper | |
| { | |
| public static void RunScripts(this MigrationBuilder migrationBuilder, string version) | |
| { | |
| var assembly = Assembly.GetExecutingAssembly(); | |
| var resourceNames = assembly.GetManifestResourceNames().Where(str => str.EndsWith(version + ".sql")); | |
| foreach (var resourceName in resourceNames) | |
| { | |
| using (var stream = assembly.GetManifestResourceStream(resourceName)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace cuahangbanle.DBData.Seed | |
| { | |
| public static class SeedData | |
| { | |
| public static async Task Seed(DBContext dbContext) | |
| { | |
| if (!dbContext.Roles.Any()) | |
| { | |
| dbContext.Roles.Add(new Role { RoleId = "Admin", RoleName = "Administrator" }); | |
| await dbContext.SaveChangesAsync(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Create ClaimsPrincipal object | |
| var principal = await CreatePrincipalAsync(user); | |
| principal.SetScopes(OpenIddictConstants.Scopes.OfflineAccess); | |
| var tokenRequest = new OpenIddictRequest(); | |
| var response = new OpenIddictResponse(); | |
| var signInResult = await HttpContext.AuthenticateAsync(OpenIddictServerAspNetCoreDefaults.AuthenticationScheme); | |
| if (signInResult.Succeeded) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Microsoft.AspNetCore.Http; | |
| using System.Collections.Concurrent; | |
| public class OneRequestAtATimeMiddleware | |
| { | |
| private readonly RequestDelegate _next; | |
| private readonly SemaphoreSlim _lock = new SemaphoreSlim(1, 1); | |
| private readonly ConcurrentQueue<HttpContext> _queue = new ConcurrentQueue<HttpContext>(); | |
| private bool _isProcessingQueue = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| protected override async Task OnInitializedAsync() | |
| { | |
| var result = await ( | |
| from csd in DbContext.ClassSessionsDetails | |
| join csm in DbContext.ClassSessionsMembers on csd.Id equals csm.CSD_Id | |
| join p in DbContext.People on csm.PeopleId equals p.Id | |
| join cl in DbContext.CompanyList on p.CompanyId equals cl.Id into companyGroup | |
| from company in companyGroup.DefaultIfEmpty() | |
| join pt in DbContext.PeopleTypes on p.TypeId equals pt.Id into peopleTypeGroup | |
| from peopleType in peopleTypeGroup.DefaultIfEmpty() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const options = { | |
| url: 'YOUR_API_ENDPOINT', | |
| responseType: 'blob', // make sure the type is blob | |
| headers: { | |
| 'Content-Type': 'application/json', | |
| // others | |
| } | |
| }; | |
| CapacitorHttp.get(options).then(response => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| col.Item().Row(row => | |
| { | |
| row.RelativeItem(0.73f).Row(innerRow => | |
| { | |
| innerRow.RelativeItem() | |
| .AlignLeft() | |
| .Text(text => | |
| { | |
| text.Span("I (we) appoint the proxy named in row A below, or, failing him or her, the proxy named in row B below, to attend and vote on my (our) behalf at the meeting of owners to be held on ") | |
| .FontSize(11); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public override IQueryable ApplyQuery(IQueryable queryable, ODataQueryOptions queryOptions) | |
| { | |
| var settings = new ODataQuerySettings | |
| { | |
| PageSize = _pageSize, | |
| EnsureStableOrdering = false, | |
| HandleNullPropagation = HandleNullPropagationOption.False, | |
| IgnoredQueryOptions = AllowedQueryOptions.Skip | |
| }; |