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
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
/// <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
// Licensed to the .NET Foundation under one or more agreements. | |
// The .NET Foundation licenses this file to you under the MIT license. | |
// See the LICENSE file in the project root for more information. | |
using System.Collections.Generic; | |
using System.Runtime.CompilerServices; | |
using System.Runtime.InteropServices; | |
using System.Threading.Tasks; | |
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
public static partial class Prelude | |
{ | |
/// <summary> | |
/// Curry the function 'f' provided. | |
/// You can then partially apply by calling: | |
/// | |
/// var curried = curry(f); | |
/// var r = curried(a)(b) | |
/// | |
/// </summary> |
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
namespace Ninject.Web | |
open Ninject.Modules | |
open Pocket.Core | |
open System | |
open System.Reflection | |
open System.Web.Mvc | |
open Ninject | |
open Microsoft.FSharp.Core.Operators |
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
module App.Directives { | |
var Directive = function (): ng.IDirective { | |
return { | |
restrict: "A", | |
scope: { | |
location: "@navigate" | |
}, | |
link: function (scope: any, el, attrs) { | |
el.click(function () { | |
document.location.href = scope.location; |
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
module App { | |
export class PagedList<T>{ | |
private page: number; | |
private list: IList<T>; | |
private items: T[]; | |
private itemsPerPage: number; | |
private numOfPages: number; | |
private count: number; | |
constructor(list: IList<T>, itemsPerPage = 10) { |
OlderNewer