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 (var session = database.BeginSession()) | |
| { | |
| session.Advanced.UpsertNamedQuery<Customer>("CustomersViaSP", qb => qb.Where(c => | |
| c.CustomerNo >= default(int) | |
| && c.CustomerNo <= default(int) | |
| && c.DeliveryAddress.Street == string.Empty)); | |
| } |
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 JsonApprovals | |
| { | |
| public static void VerifyAsJson<T>(T item) | |
| { | |
| VerifyJson(item.ToJson()); //Using extension method ToJson from ServiceStack.Text | |
| } | |
| public static void VerifyJson(string json) | |
| { | |
| Approvals.Verify(new ApprovalTextWriter(json.Dump(), "txt")); //Using extension method Dump from ServiceStack.Text |
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
| private static LambdaExpression ExpressionFactory(int customerNoFrom, int customerNoTo) | |
| { | |
| Func<Expression<Func<Customer, bool>>, LambdaExpression> fn = expression => expression; | |
| return fn(c => | |
| c.CustomerNo >= customerNoFrom && c.CustomerNo <= customerNoTo && | |
| c.DeliveryAddress.Street == "The delivery street #544"); | |
| } | |
| static void Main(string[] args) |
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 class StartNewProjectValidator : ICommandValidator<StartNewProject> | |
| { | |
| protected readonly ISisoDatabase Readstore; | |
| public StartNewProjectValidator(ISisoDatabase readstore) | |
| { | |
| Readstore = readstore; | |
| } | |
| public virtual ViolationsContainer Validate(StartNewProject cmd) |
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
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| var db = "data source=.;initial catalog=fff;integrated security=true;".CreateSql2012Db(); | |
| db.CreateIfNotExists(); | |
| var p = new Foo2 { Name = "Adam", Points = 1 }; | |
| db.UseOnceTo().Insert<Foo>(p); | |
| } |
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
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| var db = "data source=.;initial catalog=fff;integrated security=true;".CreateSql2012Db(); | |
| db.EnsureNewDatabase(); | |
| var mdoc = new Doc { Name = "MD doc" }; | |
| mdoc.Set("Substitute", "Ibuprofen"); |
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.IO; | |
| using System.Net; | |
| using System.Net.Http; | |
| using System.Net.Http.Formatting; | |
| using System.Net.Http.Headers; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| using EnsureThat; | |
| using iLogMyDay.Core.Serialization; |
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
| http://packages.nuget.org/v1/FeedService.svc/Packages?$filter=substringof('SisoDb',%20Dependencies)%20eq%20true&$select=Id,Dependencies |
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 class ReallyDoDropCreateDatabaseIfModelChanges<TContext> : IDatabaseInitializer<TContext> where TContext : DbContext | |
| { | |
| protected const string Sql = | |
| "if (select DB_ID('{0}')) is not null\r\n" | |
| + "begin\r\n" | |
| + "alter database [{0}] set offline with rollback immediate;\r\n" | |
| + "alter database [{0}] set online;\r\n" | |
| + "drop database [{0}];\r\n" | |
| + "end"; |
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 MyCouch; | |
| namespace CouchDb | |
| { | |
| public class Program | |
| { | |
| static void Main(string[] args) | |
| { |