Skip to content

Instantly share code, notes, and snippets.

View jfromaniello's full-sized avatar
😀
coding

José F. Romaniello jfromaniello

😀
coding
View GitHub Profile
private dynamic CreatePerson()
{
dynamic person = new ExpandoObject();
//Set the two commands.
person.CancelCommand = new RelayCommand(() =>
{
person.FirstName = "[First name ...]";
person.LastName = "[Last name ...]";
});
//this does not compile
new int[] {1, 2, 3, 4, 5, 6}.Select(i => new { i , root = () => i * i }) ;
//this does not compile
var query = from i in new int[] {1, 2, 3, 4, 5, 6}
select new
{
i,
root = () => i * i
};
var query = new[] {1, 2, 3, 4, 5, 6, 7}.Select(i => {
dynamic expando = new ExpandoObject();
expando.i = i;
expando.root = () => i * i;
return expando
});
foreach(dynamic item in query){
Console.WriteLine(item.root());
}
namespace GenWise.Security.Service
{
public interface ISecurityService
{
/// <summary>
/// Create a new operation.
///
/// Operation Id could be in the form of:
/// /Module/UseCase/Action
///
using System;
using NHibernate.SqlTypes;
namespace NHibernate.Type
{
/// <summary>
/// Maps a <see cref="System.Boolean" /> to a 1 char <see cref="System.Data.DbType.AnsiStringFixedLength" /> column
/// that stores a <code>'Y'/'N'</code> to indicate <code>true/false</code>.
/// </summary>
/// <remarks>
public class MyFacility : AbstractFacility
{
protected override void Init()
{
Kernel.ComponentRegistered += Kernel_ComponentRegistered;
}
void Kernel_ComponentRegistered(string key, IHandler handler)
{
<Target Name="PackResult">
<ItemGroup>
<BuildResult Include="GenWise.Security.Oracle\bin\$(Configuration)\**\GenWise*" />
<BuildResult Include="GenWise.Security.Service\bin\$(Configuration)\**\GenWise*" />
<BuildResult Include="GenWise.Security.WPF\bin\$(Configuration)\**\GenWise*" />
</ItemGroup>
<PropertyGroup>
<Target Name="PackResult">
<ItemGroup>
<BuildResult Include="GenWise.Security.Oracle\bin\$(Configuration)\**\GenWise*" />
<BuildResult Include="GenWise.Security.Service\bin\$(Configuration)\**\GenWise*" />
<BuildResult Include="GenWise.Security.WPF\bin\$(Configuration)\**\GenWise*" />
</ItemGroup>
<PropertyGroup>
public static class DictionaryExtensions
{
public static TValue GetOrAdd<TKey, TValue>(
this IDictionary<TKey, TValue> dictionary, TKey key, Func<TValue> create)
{
TValue result;
if(!dictionary.TryGetValue(key, out result))
{
result = create();
dictionary[key] = result;
using System;
using NUnit.Framework;
using SharpTestsEx;
using Suaquia.Tests.SampleDomain;
using Suquia;
namespace Suaquia.Tests
{
[TestFixture]
public class DependencyExamples