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
[ValidateArguments] | |
public virtual void RegisterUser([Required, UserName]string userName, [Required, Email]string email, [Required, Password]string password, [Required, Password]string rePassword) | |
{ | |
if (CheckAllRules(new PasswordsAreSame() { Password = password, RePassword = rePassword}, | |
new UserNameUnique() { UserName = userName }, | |
new EmailUnique() { Email = email })) | |
{ | |
User newUser = new User() | |
{ | |
UserName = userName, |
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
//Usage example: <div id="txtStartDate" data-win-datepicker="" data-ng-model="task.startDate"> | |
module dt | |
{ | |
"use strict"; | |
export function WinDatePicker($parse): ng.IDirective | |
{ | |
return { | |
restrict: 'A', | |
link(scope, element, attrs) | |
{ |
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 BindingConfig | |
{ | |
public static void Register(HttpConfiguration config) | |
{ | |
config.ParameterBindingRules.Add(FindDescriptor); | |
} | |
private static HttpParameterBinding FindDescriptor(HttpParameterDescriptor descriptor) | |
{ | |
if (descriptor.ParameterType.IsGenericType && |
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
private Action Do(Action<UnitOfWork> work) | |
{ | |
return () => _unitOfWorkFactory.Create().Do(work); | |
} | |
private Func<T> Do<T>(Func<UnitOfWork, T> work) | |
{ | |
return () => _unitOfWorkFactory.Create().Do(work); | |
} |
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
// This is app.js file | |
var request = require("request"), | |
cheerio = require("cheerio"), | |
_ = require("lodash"); | |
var foundDependencies = []; | |
function findDependencies(error, response, body, currentDependency) { | |
if (error) { | |
console.log("We’ve encountered an error: " + error); |