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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Web; | |
using System.Web.Mvc; | |
using System.Web.Routing; | |
namespace System.Web.Mvc | |
{ |
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
using Ninject; | |
using Ninject.Modules; | |
using Ninject.Web.Common; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; | |
using System.Web; | |
using System.Web.Mvc; |
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
using Ninject.Modules; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; | |
using System.Web; | |
using System.Web.Http; | |
using System.Web.Http.Dependencies; | |
// A small Library to configure Ninject (A Dependency Injection Library) with a WebAPI Application. |
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 DataRepository : IDataRepository | |
{ | |
private DbContext _dbContext; | |
public DataRepository(DbContext context) | |
{ | |
_dbContext = context; | |
} | |
public IQueryable<T> Query<T>() where T : class |
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
/// <summary> | |
/// An Abstraction for a Generic DataAccess Repoository | |
/// </summary> | |
public interface IDataRepository | |
{ | |
/// <summary> | |
/// Get all Elements of Type T | |
/// </summary> | |
/// <typeparam name="T">Entity Type</typeparam> | |
/// <returns>DbSet of Entities</returns> |
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 static class Extensions{ | |
public void Assign(this object destination, object source) | |
{ | |
if (source != null) | |
{ | |
var destProperties = destination.GetType().GetProperties(); | |
foreach (var sourceProperty in source.GetType().GetProperties()) | |
{ | |
foreach (var destProperty in destProperties) | |
{ |
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
<!-- STEP 1: Add This Script Markup to your Page.. This is the Template for the Pager --> | |
<!-- Pager Markup --> | |
<script id="od-pager.html" type="text/ng-template"> | |
<ul class="pagination" ng-show="links().length > 1"> | |
<li><a ng-click="prev()">«</a></li> | |
<li ng-class="{active:isCurrentPage(item)}" ng-repeat="item in links()"><a ng-click="goto(item)">{{item + 1}}</a></li> | |
<li><a ng-click="next()">»</a></li> | |
</ul> | |
</script> |
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
using System.Collections.Generic; | |
namespace System.Linq | |
{ | |
public static class Extensions | |
{ | |
#region IQueryable Extensions | |
public static IEnumerable<IQueryable<T>> Batch<T>(this IQueryable<T> query, int batchSize) | |
{ | |
int count = query.Count(); |
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
/// <reference path="notification.ts" /> | |
/// <reference path="../app.ts" /> | |
module App.Services { | |
export class FileService { | |
static $inject = ["_notify", "$rootScope", "$q"]; | |
scope: ng.IRootScopeService; | |
notify: NotifyService; |
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
/** | |
* Credit http://www.myersdaily.org/joseph/javascript/md5-text.html | |
*/ | |
module MD5 { | |
function md5cycle(x, k) { | |
var a = x[0], | |
b = x[1], | |
c = x[2], | |
d = x[3]; |
OlderNewer