Skip to content

Instantly share code, notes, and snippets.

View amitsinghrawat1994's full-sized avatar

Amit Singh Rawat amitsinghrawat1994

View GitHub Profile
@amitsinghrawat1994
amitsinghrawat1994 / README.md
Created April 13, 2024 15:50 — forked from qti3e/README.md
List of file signatures and mime types based on file extensions
@amitsinghrawat1994
amitsinghrawat1994 / ApplicationDbContext.cs
Created June 11, 2021 03:11 — forked from DiomedesDominguez/ApplicationDbContext.cs
The main goal of ModelBuilderExtentions.cs is to use DataAnnotations more in our tables instead of using Fluent. The other files are mere examples.
namespace MyDotNetCore.App
{
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
public class ApplicationDbContext : IdentityDbContext
{
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
: base(options)
{
}
@amitsinghrawat1994
amitsinghrawat1994 / DataContext.js
Created November 2, 2020 13:13 — forked from kamranayub/DataContext.js
A working ASP.NET Web API MVC 4 Anti-Forgery approach that also works on cloud hosts like AppHarbor. See: http://kamranicus.com/Blog/Posts/70/protip-using-anti-forgery-token-with-aspnet-web-ap
var options = {};
// jQuery options
// options.url = foo;
// CSRF Token
var csrfToken = $("input[name='__RequestVerificationToken']").val();
if (csrfToken) {
options.headers = {