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
var ua = window.navigator.userAgent; | |
var msie = ua.indexOf("MSIE "); | |
if (/Edge/.test(navigator.userAgent) || msie > -1 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) { | |
applyPolyfills().then(() => { | |
defineCustomElements(); | |
}); | |
} |
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
builder.Register(x => | |
{ | |
var optionsBuilder = new DbContextOptionsBuilder<YOURDBCONTEXTCLASS>(); | |
optionsBuilder.UseSqlServer(configuration.GetConnectionString("YOURCONNECTIONSTRING")); | |
return new YOURDBCONTEXTCLASS(optionsBuilder.Options); | |
}).InstancePerLifetimeScope() |
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
[HttpPost] | |
public ActionResult UploadFile() | |
{ | |
var Files = Request.Form.Files; // Load File collection into HttpFileCollection variable. | |
//I ONLY TAKE THE FIRST FILE FOR EXAMPLE PURPOSES | |
var imageStream = Files[0].OpenReadStream(); | |
var directories = ImageMetadataReader.ReadMetadata(imageStream); | |
var exifSubDirectory = directories.OfType<ExifSubIfdDirectory>().FirstOrDefault(); | |
var originalDate = exifSubDirectory?.GetDescription(ExifDirectoryBase.TagDateTimeOriginal); | |
return Ok(originalDate) |
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 abstract class ExifDirectoryBase : Directory | |
{ | |
public const int TagInteropIndex = 1; | |
public const int TagImageNumber = 37393; | |
public const int TagSecurityClassification = 37394; | |
public const int TagImageHistory = 37395; | |
public const int TagSubjectLocationTiffEp = 37396; | |
public const int TagExposureIndexTiffEp = 37397; | |
public const int TagStandardIdTiffEp = 37398; | |
// |
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 MyService | |
{ | |
private static Dictionary<string, string> dictionary; | |
public async Task loadData() | |
{ | |
dictionary = new Dictionary<string, string>() | |
{ | |
{"test", "test" } | |
}; |
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
IQueryable<Entity> query = dbContext.Entity.Where(x => x.Foo == "Foo") | |
foreach(var item in query) { | |
Console.WriteLine(item.ToString()) | |
} |
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
List<Entity> list = dbContext.Entity.Where(x => x.Foo == "Foo").ToList() | |
foreach(var item in list) { | |
Console.WriteLine(item.ToString()) | |
} |
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 System.Linq; | |
using System.Threading.Tasks; | |
using Microsoft.EntityFrameworkCore; | |
using WebAPI.Models; | |
using WebAPI.Models.Database3PWEB; | |
using WebAPI.Models.ViewModels; | |
namespace WebAPI.Services |
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
{ | |
"success": false, | |
"error": { | |
"code": 422, | |
"type": "customer_duplicate", | |
"detail": "Customer already exists" | |
} | |
} |
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
{ | |
"message": "Customer not found.", | |
"documentation":"https://example.com/docs/readme | |
} |