This file contains 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 NUnit.Framework; | |
using System; | |
using System.Collections.Generic; | |
using System.Data; | |
using System.Linq; | |
using System.Linq.Expressions; | |
namespace UnitTest | |
{ |
This file contains 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
//EF core 3.1 | |
public static class IQueryableExtensions | |
{ | |
public static string ToSql<TEntity>(this IQueryable<TEntity> query) where TEntity : class | |
{ | |
var enumerator = query.Provider.Execute<IEnumerable<TEntity>>(query.Expression).GetEnumerator(); | |
var relationalCommandCache = enumerator.Private("_relationalCommandCache"); |
This file contains 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
var server = require('../server'); | |
var ds = server.dataSources.db; | |
var lbTables = | |
[ | |
'User', 'AccessToken', 'ACL', 'RoleMapping', 'Role', | |
'AnswersForAQuestion','ApplicationUser','Question','Quiz','UsersQuizs' | |
]; | |
ds.automigrate(lbTables, function(er) { | |
if (er) throw er; | |
console.log('Loopback tables [' + lbTables + '] created in ', ds.adapter.name); |
This file contains 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"?> | |
<!-- | |
For more information on how to configure your ASP.NET application, please visit | |
http://go.microsoft.com/fwlink/?LinkId=301879 | |
--> | |
<configuration> | |
<configSections> | |
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> | |
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> | |
</configSections> |
This file contains 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
<dependentAssembly> | |
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" /> | |
<bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0" /> | |
</dependentAssembly> | |
<dependentAssembly> | |
<assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" /> | |
<bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0" /> | |
</dependentAssembly> | |
<dependentAssembly> | |
<assemblyIdentity name="Microsoft.Owin.Security.OAuth" publicKeyToken="31bf3856ad364e35" culture="neutral" /> |
This file contains 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
<template> | |
<select value.bind="selected"> | |
<option repeat.for="item of arr" value.bind="item.value">${item.label}</option> | |
</select> | |
</template> |
This file contains 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
//https://github.com/tungptvn/co | |
const co = function (fn) { | |
var gen = fn() | |
return new Promise((reslove, reject) => { | |
var queue = [] | |
function resume(data) { | |
if (data.done) { | |
reslove(Promise.all(queue)) | |
return |
This file contains 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
//https://github.com/tungptvn/co | |
const co = function (fn) { | |
var gen = fn() | |
return new Promise((reslove, reject) => { | |
var queue = [] | |
function resume(data) { | |
if (data.done) { | |
reslove(Promise.all(queue)) | |
return |
This file contains 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
<template> | |
<require from="./my-element"></require> | |
<div class="content-panel"> | |
<my-element task.bind="fc" on-completed.call="updateDescription()" save.delegate="parentMethod($event)"></my-element> | |
</div> | |
parentProperty = '${parentProperty}' | |
</template> |
This file contains 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
{ | |
"name": "AnswersForAQuestion", | |
"base": "PersistedModel", | |
"idInjection": true, | |
"options": { | |
"validateUpsert": true | |
}, | |
"properties": { | |
"questionId": { | |
"type": "number", |
NewerOlder