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
// User defined type | |
int myUserDefinedTypeNumber = 1; | |
string myUserDefinedTypeString = "Hello"; | |
bool myUserDefinedTypeBool = true; | |
// Compiler defined type | |
var myCompilerDefinedTypeNumber = 1; | |
var myCompilerDefinedTypeString = "Hello"; | |
var myCompilerDefinedTypeBool = true; |
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 (var file = File.OpenRead(CARD_ROOT_PATH + "card.raw")) | |
{ | |
// Code which uses the file object | |
} |
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
{ | |
"buildOptions": { | |
"emitEntryPoint": true, | |
"preserveCompilationContext": true, | |
"compile": { | |
"exclude": [ "node_modules" ] | |
} | |
}, | |
"tools": { | |
"SomeToolsRemovedForBrevity": true |
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 void ConfigureServices(IServiceCollection services) | |
{ | |
// Add framework services. | |
services.AddApplicationInsightsTelemetry(Configuration); | |
services.AddMvc(); | |
// Add SQLite DB using EF Core | |
var path = PlatformServices.Default.Application.ApplicationBasePath; | |
var connection = $"Filename={Path.Combine(path, "mydb.db")}"; |
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 Microsoft.Data.Entity; | |
using Microsoft.Data.Entity.Metadata; | |
public class MyDBContext : DBContext | |
{ | |
public DbSet<Blog> Blog { get; set; } | |
public DbSet<Post> Posts { get; set; } | |
protected override void OnModelCreating(ModelBuilder modelBuilder) | |
{ |
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
# Colour settings best suited to a terminal with a dark background | |
[color "status"] | |
added = white green bold | |
changed = yellow reverse | |
untracked = white red bold | |
[color "branch"] | |
current = yellow reverse | |
local = yellow | |
remote = green | |
[color "diff"] |
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
<!-- http://getbootstrap.com/components/#panels --> | |
<div class="row"> | |
<div class="col-md-2"> | |
<div class="panel panel-default"> | |
<div class="panel-heading"> | |
<h3 class="panel-title">Panel title</h3> | |
</div> | |
<div class="panel-body"> | |
Panel content | |
</div> |
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
{ | |
"dependencies": { | |
"EntityFramework.Sqlite": "7.0.0-rc1-final", | |
"EntityFramework.Commands": "7.0.0-rc1-final", | |
"Microsoft.Extensions.PlatformAbstractions": "1.0.0-rc1-final" | |
}, | |
"commands": { | |
"web": "Microsoft.AspNet.Server.Kestrel --server.urls=http://*:9000/", | |
"ef": "EntityFramework.Commands" | |
} |
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 Microsoft.Data.Entity; | |
namespace CodingMonkey.Models | |
{ | |
public class CodingMonkeyContext : DbContext | |
{ | |
public DbSet<Exercise> Exercises { get; set; } | |
public DbSet<ExerciseTemplate> ExerciseTemplates { get; set; } | |
public DbSet<ExerciseCategory> ExerciseCategories { get; set; } | |
public DbSet<Test> Tests { get; set; } |
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
λ dnx ef migrations add Initial | |
System.InvalidOperationException: The property 'ExerciseTemplateId' cannot exist on entity type 'object' because the property is not marked as shadow state and no corresponding CLR property exists on the underlying type. | |
at Microsoft.Data.Entity.Metadata.Internal.Property.set_IsShadowProperty(Nullable`1 value) | |
at Microsoft.Data.Entity.Metadata.Internal.InternalPropertyBuilder.Shadow(Nullable`1 isShadowProperty, ConfigurationSource configurationSource) | |
at Microsoft.Data.Entity.Metadata.Internal.InternalPropertyBuilder.Attach(InternalEntityTypeBuilder entityTypeBuilder, ConfigurationSource configurationSource) | |
at Microsoft.Data.Entity.Metadata.Internal.InternalEntityTypeBuilder.PropertyBuildersSnapshot.Attach(InternalEntityTypeBuilder entityTypeBuilder) | |
at Microsoft.Data.Entity.Metadata.Internal.InternalEntityTypeBuilder.HasBaseType(EntityType baseEntityType, ConfigurationSource configurationSource) | |
at Microsoft.Data.Entity.Metadata.Conventions.Internal.DerivedT |