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
| open Simple.Data | |
| open Xunit | |
| open Swensen.Unquote | |
| open ImpromptuInterface.FSharp | |
| [<Fact>] | |
| let ``Simple.Data data provider test`` () = | |
| Database.UseMockAdapter(new InMemoryAdapter()) | |
| let db = Database.Open() | |
| db?Test?Insert(dynArg(1) ? Id, dynArg("Alice") ? Name) |
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 System | |
| using System.Collections.Generic | |
| using System.Data | |
| using System.Data.SqlClient | |
| using System.Linq | |
| using Simple.Data.Ado | |
| using Simple.Data.Ado.Schema | |
| namespace Simple.Data.SqlServer | |
| class SqlSchemaProvider : ISchemaProvider |
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 System; | |
| using System.Collections.Generic; | |
| using System.Data; | |
| using System.Data.SqlClient; | |
| using System.Linq; | |
| using Simple.Data.Ado; | |
| using Simple.Data.Ado.Schema; | |
| namespace Simple.Data.SqlServer | |
| { |
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
| module BorrowABook = | |
| type BookLoanProblem = | |
| NotInCatalogue | |
| | OutOnLoan | |
| | InsufficientPermission | |
| | Failed of string | |
| type Book = Book | |
| type BookModel = BookModel |
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 System; | |
| using System.Linq; | |
| using Raven.Abstractions.Data; | |
| using Raven.Abstractions.Logging; | |
| using Raven.Bundles.Replication.Plugins; | |
| using Raven.Json.Linq; | |
| namespace RavenConflictResolverPlugin | |
| { | |
| public class LastInWinsReplicationConflictResolver |
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 System; | |
| using System.Collections.Generic; | |
| namespace ConsoleApplication1 { | |
| class Program { | |
| static void Main() { | |
| //-- define an Action that will perfom a query | |
| Action<List<string>> query = r => r.AddRange(QuerySomething()); | |
| //-- invoke it and show results ;) |
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
| var get = (function() { | |
| var overrides = { | |
| getAll: function() { | |
| console.log('return all...'); | |
| return this; | |
| }, | |
| getById: function(args) { | |
| console.log('return by id:' + args); | |
| return this; | |
| }, |
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
| getAll(); | |
| getById(5); | |
| getByExpr('id > 5'); |
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
| get(); | |
| get(5); | |
| get('id > 5'); |
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 Simplr.Middleware { | |
| public class ResourceResolver : MiddlewareBase { | |
| public override Task Process(IContext context) {...} | |
| } | |
| public class HypermediaValidator : MiddlewareBase { | |
| public override Task Process(IContext context) {...} | |
| } | |
| //... | |
| //additional middleware components | |
| } |