Search Results

Search found 6 results on 1 pages for 'raffaeu'.

Page 1/1 | 1 

  • Microsoft Unity, parameters in constructor

    - by raffaeu
    I am using Unity with MVC and NHibernate. Unfortunately, our UnitOfWork resides in a different .dll and it doesn't have a default empty .ctor. This is what I do to register NHibernate: var connectionString = ConfigurationManager.ConnectionStrings["jobManagerConnection"].ConnectionString; var assemblyMap = ConfigurationManager.AppSettings["assemblyMap"]; container .RegisterType<IUnitOfWork, UnitOfWork>(new ContainerControlledLifetimeManager()); In my WebController I have this: /// <summary>Gets or sets UnitOfWork.</summary> [Dependency] public IUnitOfWork UnitOfWork { get; set; } The problem is that the constructor of UnitOfWork expects 2 mandatory strings. How I can setup the RegisterType for this Interface in order to pass the two parameters retreived from the web.config? Is it possible?

    Read the article

  • AutoMapper and Linq expression.

    - by Raffaeu
    I am exposing the Dto generated from AutoMapper to my WCF services. I would like to offer something like that from WCF: IList GetPersonByQuery(Expression predicate); Unfortunately I need back an expression tree of Person as my DAL doesn't know the DTO. I am trying this wihtout success: var func = new Func<Person, bool>(x => x.FirstName.Contains("John")); var funcDto = Mapper.Map<Func<Person, bool>, Func<PersonDto, bool>>(func); Console.WriteLine(func.ToString()); Console.WriteLine(funcDto.ToString()); THe error that I get is: ----> System.ArgumentException : Type 'System.Func`2[TestAutoMapper.PersonDto,System.Boolean]' does not have a default constructor Do you have any suggestions?

    Read the article

  • Action T synchronous and asynchronous

    - by raffaeu
    Hi everybody I have a contextmenustrip control that allows you to execute an action is two different flawours. Sync and Async. I am trying to covert everything using Generics so I did this: public class BaseContextMenu<T> : IContextMenu { private T executor ... public void Exec(Action<T> action){ action.Invoke(this.executor); } public void ExecAsync(Action<T> asyncAction){ ... } How I can write the async method in order to execute the generic action and 'do something' with the menu in the meanwhile? I saw that the signature of BeginInvoke is something like: asyncAction.BeginInvoke(thi.executor, IAsyncCallback, object);

    Read the article

  • Windows Form UserControl design time properties

    - by Raffaeu
    I am struggling with a UserControl. I have a UserControl that represent a Pager and it has a Presenter object property exposed in this way: [Browsable(false)] [DesignSerializationAttribute(DesignSerializationAttribute.Hidden)] public object Presenter { get; set; } The code itself works as I can drag and drop a control into a Windows From without having Visual Studio initializing this property. Now, because in the Load event of this control I call a method of the Presenter that at run-time is null ... I have introduced this additional code: public override void OnLoad(...) { if (this.DesignMode) { base.OnLoad(e); return; } presenter.OnViewReady(); } Now, every time I open a Window that contains this UserControl, Visual Studio modifies the Windows designer code. So, as soon as I open it, VS ask me if I want to save it ... and of course, if I add a control to the Window, it doesn't keep the changes ... As soon as I remove the UserControl Pager the problem disappears ... How should I tackle that in the proper way? I just don't want that the presenter property is initialized at design time as it is injected at runtime ...

    Read the article

  • Move from TFS 2008 to TFS 2010

    - by raffaeu
    We have succesfully built our TFS 2010 infrastructure and the first VM using Visual Studio 2010. Now I have a very simple question. How I can move a solution from our existing TFS 2008 to the new one 2010? Is there any tool included in TFS?

    Read the article

  • Linq List contains specific values.

    - by Raffaeu
    I need to know if the List I am working with contains only some specific values. var list = new List<string> { "First", "Second", "Third" }; If I want to know if the List contain at least one item with the value "First" I use the Any keyword: var result = list.Any(l => l == "First"); But how I can write a Linq expression that will return true/false only if the List contains "First" and "Second" values?

    Read the article

1