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 class MyDbContext : MyContext | |
{ | |
protected override void OnModelCreating(ModelBuilder modelBuilder) | |
{ | |
base.OnModelCreating(modelBuilder); | |
modelBuilder.Entity<MyEntity>(entity => | |
{ | |
entity.Property(e => e.MyProperty) | |
.HasColumnType("nvarchar(4000)"); |
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 class MyDbContext : MyContext | |
{ | |
private readonly string connectionString; | |
public MyDbContext(string connectionString) : base() | |
{ | |
this.connectionString = connectionString; | |
} | |
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) | |
{ |
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
<Project Sdk=”Microsoft.NET.Sdk”> | |
<PropertyGroup> | |
<TargetFramework>netcoreapp2.0</TargetFramework> | |
</PropertyGroup> | |
<ItemGroup> | |
<PackageReference Include=”Microsoft.EntityFrameworkCore.Design” Version=”2.0.0" /> | |
<PackageReference Include=”Microsoft.EntityFrameworkCore.SqlServer” Version=”2.0.0" /> | |
</ItemGroup> | |
<ItemGroup> | |
<DotNetCliToolReference Include=”Microsoft.EntityFrameworkCore.Tools.DotNet” Version=”2.0.0" /> |
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 class UnitTest1 | |
{ | |
[Fact] | |
public void Test1() | |
{ | |
Assert.Equal(1, 1); | |
} | |
} |
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
FROM microsoft/aspnetcore | |
# set up network | |
ENV ASPNETCORE_URLS http://+:5000 | |
WORKDIR /app | |
EXPOSE 5000 | |
COPY . /app | |
ENTRYPOINT ["dotnet", "netcoreapp.dll"] |
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 the jenkins version, to upgrade the base image, alter the argument below | |
ARG JENKINS_VERSION=2.60.2 | |
FROM jenkins:$JENKINS_VERSION | |
LABEL name "netcorebuild" | |
MAINTAINER Maarten Merken | |
ARG NET_CORE_APP_NAME=netcoreapp | |
ARG JENKINS_CLI_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/cli/$JENKINS_VERSION/cli-$JENKINS_VERSION-jar-with-dependencies.jar | |
# get rid of admin password setup | |
ENV JAVA_OPTS="-Djenkins.install.runSetupWizard=false" |
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'?> | |
<flow-definition plugin="workflow-job@2.11"> | |
<actions/> | |
<description></description> | |
<keepDependencies>false</keepDependencies> | |
<properties> | |
<org.jenkinsci.plugins.workflow.job.properties.PipelineTriggersJobProperty> | |
<triggers> | |
<hudson.triggers.SCMTrigger> | |
<spec>* * * * *</spec> |
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
import groovy.json.JsonSlurper | |
VERSION_NUMBER = "" | |
/** Pipeline **/ | |
node { | |
ws('netcore') { | |
try{ | |
stage("scm pull") { | |
deleteDir(); |
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
//GLOBAL VARIABLE | |
VERSION_NUMBER = "" | |
/** Pipeline **/ | |
node { | |
ws('myapp') { | |
try{ | |
stage("scm pull") { | |
cloneRepo(); | |
VERSION_NUMBER = "1.2.3" | |
currentBuild.displayName = "$VERSION_NUMBER"; |
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 System; | |
using System.Data; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Mvc.Filters; | |
namespace txn | |
{ | |
public class UnitOfWorkFilter : IAsyncActionFilter | |
{ | |
private readonly IDbTransaction transaction; |
OlderNewer