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 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 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 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 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 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
[TestClass] | |
public class MyServiceTests : BaseTest | |
{ | |
[TestMethod] | |
public void TestMethod() | |
{ | |
var result = _myService.myMethod() | |
Assert.IsNotNull(result); | |
} | |
} |
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
[TestClass] | |
public abstract class BaseTest | |
{ | |
public static ServiceProvider serviceProvider; | |
public IMyService _myService; | |
[AssemblyInitialize] | |
public static void SetUp(TestContext context) | |
{ | |
IServiceCollection services = new ServiceCollection(); | |
services.AddTransient<IMyService, MyService>(); |
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
services.AddSwaggerGen(c => | |
{ | |
c.SwaggerDoc("v1", new OpenApiInfo { Title = "Mediris Recipe API", Version = "v1" }); | |
c.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme | |
{ | |
Description = "JWT Authorization header using the Bearer scheme. \r\n\r\n Enter 'Bearer' [space] and then your token in the text input below.\r\n\r\nExample: \"Bearer 12345abcdef\"", | |
Name = "Authorization", | |
In = ParameterLocation.Header, | |
Type = SecuritySchemeType.ApiKey, | |
Scheme = "Bearer" |
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 JsonStatusCodeMiddleWare | |
{ | |
private readonly RequestDelegate _next; | |
public JsonStatusCodeMiddleWare(RequestDelegate next) | |
{ | |
_next = next; | |
} | |
public async Task Invoke(HttpContext context) | |
{ | |
if (context.Response.StatusCode == (int)HttpStatusCode.OK) |
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
builder.UseMvc(routes => | |
{ | |
routes.MapRoute("apiDefault", "api/{*url}", new { controller = "Home", action = "ApiNotFound" }); | |
routes.MapRoute("spa-routes", "{*anything}", new { controller = "Home", action = "Index" }); | |
}); |
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
const webpack = require("webpack"); | |
module.exports = { | |
outputDir: '../wwwroot/dist', | |
publicPath: "/dist/", | |
filenameHashing: false, | |
configureWebpack: { | |
plugins: [ | |
new webpack.ProvidePlugin({ | |
$: 'jquery', |