Skip to content

Instantly share code, notes, and snippets.

View akhileshnirapure's full-sized avatar

Akhilesh Nirapure akhileshnirapure

View GitHub Profile
// Amikiri/src/Amikiri.Api/Infrastructure/Filters/ValidationExceptionFilter.cs
namespace Amikiri.Api.Infrastructure.Filters
{
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http.Filters;
using global::FluentValidation;
// UnhandledExceptionFilterAttribute.cs
// http://stackoverflow.com/questions/12519561/throw-httpresponseexception-or-return-request-createerrorresponse
// http://pastebin.com/Uu65fRwT
// https://blog.iamandycohen.com/2013/02/09/webapi-and-the-behavior-of-exceptions-and-an-alternative-configurable-way-to-deal/
// https://github.com/iamandycohen/Omegaluz.GlobalApiExceptions/blob/master/ExampleApi/App_Start/WebApiExceptionConfig.cs
namespace Northwind.WebApi2Services.Filters
{
using System;
var startModule = function (jQuery,userInfoWeb,userInfoProfile) {
function ShowUserName() {
userInfoWeb.getUserName();
userInfoProfile.getUserName();
};
SP.SOD.loadMultiple(['sp.js', 'userprofile'], ShowUserName);
var userProfileModule = function (jQuery) {
// Define user class/module
var userProfileInfoModule = function () {
function _getUserName() {
var userProfileProperties;
//Get Current Context
@akhileshnirapure
akhileshnirapure / MODULE_SP_USER
Last active August 29, 2015 14:00
Module for Web
var userInfoWebModule = function (jQuery) {
// Define user class/module
var userModule = function () {
function _getUserName() {
var context = SP.ClientContext.get_current();
var user = context.get_web().get_currentUser();
@akhileshnirapure
akhileshnirapure / sphrequire_config
Created April 24, 2014 11:41
SharePoint Hosted App + RequireJS Config
define(function () {
//debugger;
var rconfig = {
baseUrl: '../Scripts/app',
deps:
[
'spruntime_js','sp_js'
],
paths: {