Skip to content

Instantly share code, notes, and snippets.

View ArnisL's full-sized avatar
🦊

Arnis Lapsa ArnisL

🦊
View GitHub Profile
namespace MyProject.Web.Binders{
using System.Web.Mvc;
using Domain;
public class RootBinder<TRoot,TRepository>:DefaultModelBinder
where TRepository:IRepository<TRoot> where TRoot:IRoot{
private readonly TRepository _repository;
public RootBinder(TRepository repository){
Guard.AgainstNull(repository);
_repository=repository;
}
namespace MyProject.Web.Binders{
using System.Web.Mvc;
using Domain;
public class RootBinder<TRoot,TRepository>:DefaultModelBinder
where TRepository:IRepository<TRoot> where TRoot:IRoot{
private readonly TRepository _repository;
public RootBinder(TRepository repository){
Guard.AgainstNull(repository);
_repository=repository;
}
namespace Interreg.Web.Bootstrap{
using System;
using Config;
using Microsoft.Practices.ServiceLocation;
using MvcExtensions;
using NHibernate;
using NHibernate.Context;
using StructureMap;
public class NHibernateTask:BootstrapperTask{
private readonly IContainer _container;
namespace Interreg.Config{
using System;
using System.IO;
using Domain;
using FluentNHibernate.Automapping;
using FluentNHibernate.Cfg;
using FluentNHibernate.Cfg.Db;
using FluentNHibernate.Conventions.Helpers;
using NHibernate;
using NHibernate.Context;
namespace Web.Bootstrap {
using CommandHandlers;
using Microsoft.Practices.ServiceLocation;
using MvcExtensions;
using Ncqrs;
using Ncqrs.Commanding.ServiceModel;
using Ncqrs.Config.StructureMap;
using Ncqrs.Domain;
using Ncqrs.Domain.Storage;
using Ncqrs.Eventing.ServiceModel.Bus;
protected override void ExecuteInContext(IUnitOfWorkContext context, RegisterNewAffairCmd cmd)
{
var affair=Affair.RegisterAffair(cmd.AffairId, cmd.Name, cmd.Location);
//how to save it? :/
context.
_repository.Save(affair);
context.Accept();
}
/// <summary>
/// Validates that record is found in Aleph by GetDigitalObjectFromAleph method
/// or user has processed it.
/// Filters records which were not found in Aleph by GetDigitalObjectFromAleph method
/// and not processed by user.
/// </summary>
/// <param name="codeTableCode">The code table code.</param>
/// <param name="value">The value.</param>
/// <param name="elementId">The element id.</param>
/// <param name="elementName">Name of the element.</param>