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
/* This is a template command. */ | |
CmdUtils.CreateCommand({ | |
name: "kino", | |
/*icon: "http://example.com/example.png", | |
homepage: "http://example.com/", | |
author: {name: "Your Name", email: "you@example.com"}, | |
license: "GPL", | |
description: "A short description of your command", | |
help: "How to use your command", |
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
XmlMetadataSource source = XmlMetadataSource.FromAssemblyResource("Northwind.rlinq"); | |
var model = source.GetModel(); | |
var productType = model.PersistentTypes.FirstOrDefault(x => x.Name == "Product"); | |
productType.OptimisticConcurrencyControlStrategy = OptimisticConcurrencyControlStrategy.Timestamp; | |
//Making sure there is no cached database. | |
Database.Get("NorthwindEntityDiagrams", new BackendConfiguration() { Backend = "mssql" }, model).Dispose(); | |
//initialize the database with the modified metadata |
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
//Create a FluentMetadataSource and retrieve the MetadataContainer from it. | |
Source source = new Source(); | |
MetadataContainer model = source.GetModel(); | |
//We are passing in false in order to specify no resolution actions should be added. | |
//A resolution action is a proposed by the rule fix for the problem and pops up in the designer. | |
MetaModelValidation validation = new MetaModelValidation(false); | |
//Specify the custom validation rule provider | |
validation.ValidationRuleProvider = new SitefinityValidationProvider(); |
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
public interface IUnitOfWork | |
{ | |
void Delete(object entity); | |
void SaveChanges(); | |
void ClearChanges(); | |
void Add(object entity); |
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
# Need to load MSBuild assembly if it's not loaded yet. | |
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' | |
# Grab the loaded MSBuild project for the project | |
$msbuild = [Microsoft.Build.Evaluation.ProjectCollection]::GlobalProjectCollection.GetLoadedProjects($project.FullName) | Select-Object -First 1 | |
# Make the path to the targets file relative. | |
$projectUri = new-object Uri('file://' + $project.FullName) | |
$targetUri = new-object Uri('file://' + $targetsFile) | |
$relativePath = $projectUri.MakeRelativeUri($targetUri).ToString().Replace([System.IO.Path]::AltDirectorySeparatorChar, [System.IO.Path]::DirectorySeparatorChar) | |
$existsCondition = "Exists('" + $relativePath + "')" |
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
// на пръв поглед един блок | |
public SqlExpressionVisitor() { | |
modelDef = typeof(T).GetModelDefinition(); | |
PrefixFieldWithTableName = false; | |
WhereStatementWithoutWhereString = false; | |
} | |
// ясно разделение между заглавие и съдържание | |
public SqlExpressionVisitor() | |
{ |
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 logger = new ILogger(); | |
// Shortcut with just a message | |
logger.Error("Something bad happened"); | |
// Shortcut for type | |
logger.Error(entry => entry.Message("Too many Cordova plugins used") |
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
- restore_cache: | |
keys: | |
- recorder-{{ .Branch }} | |
paths: | |
- /caches/app.tar | |
- run: | |
name: Load Docker image layer cache | |
command: | | |
set +o pipefail | |
docker load -i /caches/app.tar | true |