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
<table class="table"> | |
<thead> | |
<tr> | |
<th>Date</th> | |
<th>Temp. (C)</th> | |
<th>Temp. (F)</th> | |
<th>Summary</th> | |
</tr> | |
</thead> | |
<tbody> |
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 DataContext : DbContext | |
{ | |
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) | |
{ | |
optionsBuilder.UseSqlServer(@"Server=.\SQLEXPRESS;Database=EFCoreOptimisticConcurrency;Trusted_Connection=True;"); | |
} | |
public DbSet<Product> Products { get; set; } | |
} |
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
# Starter pipeline | |
# Start with a minimal pipeline that you can customize to build and deploy your code. | |
# Add steps that build, run tests, deploy, and more: | |
# https://aka.ms/yaml | |
trigger: | |
- master | |
pool: | |
vmImage: 'ubuntu-latest' |
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.Threading.Tasks; | |
using System.Net.Http; | |
private static HttpClient httpClient = new HttpClient(); | |
public static void Run(TimerInfo myTimer, ILogger log, out string outputBlob) | |
{ | |
var response = httpClient.GetAsync("http://api.openweathermap.org/data/2.5/weather?q=olsztyn,pl&APPID=4e61d7e7f40f9c3205722f24ebd3c2ac").Result; | |
outputBlob = response.Content.ReadAsStringAsync().Result; |
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
<ItemGroup> | |
<ProjectReference Include="..\EFCoreMigrations.Web\EFCoreMigrations.Web.csproj" GlobalPropertiesToRemove="SelfContained" /> | |
</ItemGroup> |
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 WebApiConfig | |
{ | |
public static void Register(HttpConfiguration config) | |
{ | |
// Add only Json formatter for Postman import | |
config.Formatters.Clear(); | |
config.Formatters.Add(new JsonMediaTypeFormatter()); | |
// Web API routes | |
config.MapHttpAttributeRoutes(); |
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 partial class AdminSettingsView : Window, ISettingsView | |
{ | |
public AdminSettingsView() | |
{ | |
InitializeComponent(); | |
} | |
public double OrderNumber => 10; | |
public bool CanShow(ApplicationContext context) |
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 DatabaseRestoreService : IDatabaseRestoreService | |
{ | |
private static NLog.Logger _logger = NLog.LogManager.GetCurrentClassLogger(); | |
public Result Restore(string connectionString) | |
{ | |
var connectionBuilder = new SqlConnectionStringBuilder(connectionString); | |
var databaseName = connectionBuilder.InitialCatalog; | |
_logger.Info($"Restore snapshot for {databaseName} database"); |
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 BaseModel | |
{ | |
public BaseModel() | |
{ | |
IsActive = true; | |
} | |
public int Id { get; set; } | |
public bool IsActive { get; set; } |
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 DatabaseRestoreService : IDatabaseRestoreService | |
{ | |
private Lazy<DataContext> _dataContext; | |
protected DataContext DataContext => _dataContext.Value; | |
public DatabaseRestoreService(Lazy<DataContext> dataContext) | |
{ | |
_dataContext = dataContext; |