Skip to content

Instantly share code, notes, and snippets.

<?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>
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))
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))
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();
// 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)
{
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;
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()
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 => {
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);
public override IQueryable ApplyQuery(IQueryable queryable, ODataQueryOptions queryOptions)
{
var settings = new ODataQuerySettings
{
PageSize = _pageSize,
EnsureStableOrdering = false,
HandleNullPropagation = HandleNullPropagationOption.False,
IgnoredQueryOptions = AllowedQueryOptions.Skip
};