Skip to content

Instantly share code, notes, and snippets.

View sphingu's full-sized avatar
:dependabot:
Focusing

Sumit Hingu sphingu

:dependabot:
Focusing
View GitHub Profile
public class LibraryContext : DbContext
{
public LibraryContext()
: base("name=DbConnectionString")
{ }
public DbSet<Publisher> Publishers { get; set; }
public DbSet<Book> Books { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
@sphingu
sphingu / Configuratoin&RunPhase.html
Created February 25, 2014 06:38
AngularJsHub.Com Module Example
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>Configuration and Run phases</title>
<script src="angular.min.js"></script>
<script type="text/javascript">
var PersonManager = function () {
var fullNameSeparator = " ";
@sphingu
sphingu / NestedController.html
Created February 25, 2014 04:46
AngularJSHub.com Examples Basic
<!DOCTYPE html>
<html ng-app>
<head>
<meta charset="utf-8" />
<title>Nested Controller</title>
<script src="angular.min.js"></script>
<script src="nestedScript.js"></script>
</head>
<body>
@sphingu
sphingu / FirstAngularApp.html
Created February 18, 2014 11:56
FirstAngularApp
<html ng-app >
<head>
<title>First Application</title>
<!--<script type="text/javascript" src="jquery-1.10.2.js"></script>-->
<script type="text/javascript" src="angular.min.js"></script>
<script type="text/javascript">
function AlbumController($scope) {
$scope.images = [
{ "thumbnail": "img/1.png", "description": "Bootstrap MVC" },
{ "thumbnail": "img/2.png", "description": "Happy Holiday" }
@sphingu
sphingu / DateTime.cshtml
Last active September 13, 2015 17:22
Display Templates & Editor Templates in MVC
//EditorTEmplated in Shred FOlder
@{
string name = ViewData.TemplateInfo.HtmlFieldPrefix;
string id = name.Replace(".", "_");
string value = "";
if (Model != null) { value = Model.ToShortDateString(); }
}
<input type="text" id="@id" class="txt" value="@value" />
<script type="text/ecmascript">
@sphingu
sphingu / Dynamic_Load_On_Scroll_Jquery.html
Created June 20, 2013 12:37
Loading content on scroll to bottom on page using Jquery
<html>
<head>
<title>Scroll to bottom Detection</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
var count=0;
$(document).ready(function(){
SetValues();
$(window).scroll(function(){
//Will check if the user has reached bottom of a PAGE
Install-Package EntityFramework
Update-Database -Verbose -Force
Enable-Migrations -EnableAutomaticMigrations -Force
Add-Migration //not compulsory
int
string
DateTime
byte[] for binary image
Guid
@sphingu
sphingu / MVC_InterView_Questions.md
Created June 19, 2013 09:18
MVC Interview Questions

Interview Question


1.In which assembly is the MVC framework defined? System.Web.Mvc

2.What is ViewData, ViewBag and TempData?

  MVC offers Three options for passing data from controller to View and  in next request. 
ViewData & ViewBag are almost similar.
  	Short life means value becomes null when redirection occurs.
		It’s a communication mechanism within the server call.
Difference between ViewBag & ViewData:
@sphingu
sphingu / Multiple_File_Upload.cs
Last active December 18, 2015 15:39
Multiple File Upload in MVC
http://www.mindstick.com/Articles/518b07f7-3fc8-4b86-8ab9-cab49ecb001a/
//In View
<form action="@Url.Action("UploadPayment")" method="post" enctype="multipart/form-data">
<input type="file" name="FileUploads" id="FileUploads1" />
<input type="file" name="FileUploads" id="FileUploads2" />
//In Model
public IEnumerable<HttpPostedFileBase> FileUploads { get; set; }
@sphingu
sphingu / PositiveInteger.js
Created June 18, 2013 13:46
Only Positive Integer allow in Textbox using JQuery
$(".positive-integer").numeric({ decimal: false, negative: false }, function () { alert("Positive integers only"); this.value = ""; this.focus(); });