This file contains hidden or 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 Color FromHexa(string hexaColor) | |
{ | |
return Color.FromArgb( | |
Convert.ToByte(hexaColor.Substring(1, 2), 16), | |
Convert.ToByte(hexaColor.Substring(3, 2), 16), | |
Convert.ToByte(hexaColor.Substring(5, 2), 16), | |
Convert.ToByte(hexaColor.Substring(7, 2), 16) | |
); | |
} |
This file contains hidden or 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 CategoryController | |
{ | |
[HttpGet] | |
public ActionResult AddNewCategory() | |
{ | |
return View(new CategoryModel()); | |
} | |
[HttpPost] | |
public ActionResult AddNewCategory(CategoryModel model) |
This file contains hidden or 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 CompareExtensions | |
{ | |
public static IEnumerable<T> Distinct<T>(this IEnumerable<T> items, Func<T, T, bool> equals, Func<T, int> hashCode) | |
{ | |
return items.Distinct(new DelegateEqualityComparer<T>(equals, hashCode)); | |
} | |
public static IEnumerable<T> Distinct<T>(this IEnumerable<T> items, Func<T, T, bool> equals) | |
{ | |
return items.Distinct(new DelegateEqualityComparer<T>(equals, null)); |
This file contains hidden or 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
; (function(jsShop, window, document, undefined) { | |
var product = jsShop.product = jsShop.product || (function() { | |
//an implementation like shoppingCart | |
}()); | |
}(window._jsShop = window._jsShop || {}, window, document)); |
This file contains hidden or 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 SafeCommandService : CommandService | |
{ | |
public override void Execute(ICommand command) | |
{ | |
try | |
{ | |
base.Execute(command); | |
} | |
catch(ConcurrencyException ex) | |
{ |
This file contains hidden or 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
var productDialog = function($){ | |
var self = null; | |
var dialogForm = null; | |
var init = function() { | |
if (self === null) return; | |
self = this; | |
initDialog(); | |
}; | |
This file contains hidden or 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 JsonResult States(string country) | |
{ | |
var states = _countryRepository.GetStates(country) | |
.Select(s => new { | |
text = s.StateName, | |
value = c.StateCode | |
}); | |
return new JsonResult { Data = states, JsonRequestBehavior = JsonRequestBehavior.AllowGet }; | |
} |
This file contains hidden or 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
[Then] | |
public void it_should_throw_an_formatted_participant_nr_should_be_unique_exception_containing_the_formatted_participant_nr() | |
{ | |
var exception = (FormattedParticipantNrShouldBeUniqueException)CaughtException; | |
exception.FormattedParticipantNr.Should().Be(_formattedParticipantNr); | |
} |
This file contains hidden or 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 abstract class BisAggregateRoot : AggregateRootMappedByConvention | |
{ | |
private readonly List<object> _appliedEvents = new List<object>(); | |
protected readonly ICredentials Credentials = NcqrsEnvironment.Get<ICredentials>(); | |
protected BisAggregateRoot() | |
{ | |
} |
This file contains hidden or 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.Data.Entity; | |
using System.Linq; | |
using System.Web; | |
using System.Web.Mvc; | |
using System.Web.Routing; | |
using Castle.Windsor; | |
using Castle.Windsor.Installer; | |
using Website.Infrastructure; |