Search Results

Search found 14 results on 1 pages for 'user137348'.

Page 1/1 | 1 

  • ASP.NET Model Binder and base type

    - by user137348
    My model inherits from an interface: public interface IGrid { ISearchExpression Search { get; set; } . . } public interface ISearchExpression { IRelationPredicateBucket Get(); } The model: public class Project : IGrid { public ISearchExpression Search { get; set; } public Project() { this.Search = new ProjectSearch(); } } The ProjectSearch: public class ProjectSearch: ISearchExpression { public string Name { get; set; } public string Number { get; set; } public IRelationPredicateBucket Get() {...} } And the strong typed partialview in the main view: <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<ProjectSearch>" %> <%= Html.TextBoxFor(x=>x.Name)%> <%= Html.TextBoxFor(x => x.Number)%> .... When I submit the form, the Search property don't get bound properly. Everything is empty.The action takes an argument of ProjectSearch type. Why the Search don't get bound as supposed ?

    Read the article

  • Adding IoC Support to my WCF service hosted in a windows service (Autofac)

    - by user137348
    I'd like to setup my WCF services to use an IoC Container. There's an article in the Autofac wiki about WCF integration, but it's showing just an integration with a service hosted in IIS. But my services are hosted in a windows service. Here I got an advice to hook up the opening event http://groups.google.com/group/autofac/browse_thread/thread/23eb7ff07d8bfa03 I've followed the advice and this is what I got so far: private void RunService<T>() { var builder = new ContainerBuilder(); builder.Register(c => new DataAccessAdapter("1")).As<IDataAccessAdapter>(); ServiceHost serviceHost = new ServiceHost(typeof(T)); serviceHost.Opening += (sender, args) => serviceHost.Description.Behaviors.Add( new AutofacDependencyInjectionServiceBehavior(builder.Build(), typeof(T), ??? )); serviceHost.Open(); } The AutofacDependencyInjectionServiceBehavior has a ctor which takes 3 parameters. The third one is of type IComponentRegistration and I have no idea where can I get it from. Any ideas ? Thanks in advance.

    Read the article

  • LLBLGen and the repository pattern

    - by user137348
    I was wondering if building a repository on the top LLBLGen (adapter) is a good idea. I don't want to overengineer and reinvent the wheel again. The DataAccessAdapter class could be some kind of a generic repository.It has all the CRUD methods you need. But on the other side for a larger project it could be good to have a layer between your ORM and service layer. I'd like to hear your opinions, if your using the repository pattern with LLBLGen,if yes why if no why not. If you have some implementation, post it please.

    Read the article

  • ASP.NET MVC 2 Areas, Strange routing behavior

    - by user137348
    I've created an Area named "Admin". I've created also a controller(Pages) and a view(List) in this areas. When I run my app and enter the url "/Admin/Pages/List" I'm getting an The resource cannot be found error. When I enter /Pages/List, the Action method is hit but the view is not found,because the app is searching in wrong directories ~/Views/Pages/List.aspx ~/Views/Pages/List.ascx ~/Views/Shared/List.aspx ~/Views/Shared/List.ascx the view is in /Admin/Pages/List. My routing conf for Admin area: public class AdminAreaRegistration : AreaRegistration { public override string AreaName { get { return "Admin"; } } public override void RegisterArea(AreaRegistrationContext context) { context.MapRoute( "Admin_default", "Admin/{controller}/{action}/{id}", new { controller= "Pages",action = "Index", id = "" } ); } }

    Read the article

  • jQuery form serialize - empty string

    - by user137348
    My html: <script type="text/javascript"> $(function() { $("#bt1").click(function() { var f = $("#form1"); var formData = f.serialize(); alert(formData); }); }); </script> <div id="div1"> <form id="form1" action="/Home/Test1" method="post" name="down"> <div id="div2"> <input id="input1" type="text" value="2" /> </div> </form> </div> <input type="submit" id="bt1" /> When I fire up the click event, formData is empty. I'm using jQuery 1.4.2.

    Read the article

  • Development enviroment for .NET

    - by user137348
    I'm about to create an development enviroment for a little developer company(3-4 developers + some testers). Our development platform is .NET and Oracle. My question is how to structure the whole enviroment.How many servers do I need ? Should be one server for developers and one for testers ? I'd like to have one build server (TeamCity). Where to put the Subversion ? Visual Studio's would be on developers laptops. Do I need one database for development and one extra for build server ? What else could be helpful ??

    Read the article

  • StructureMap singleton behavior not working

    - by user137348
    My code is public static class ContainerBootstrapper { public static void BootstrapStructureMap() { ObjectFactory.Initialize(x => x .ForRequestedType<ValueHolder>() .CacheBy(InstanceScope.Singleton) .TheDefaultIsConcreteType<ValueHolder>()); } } Initialization code (its a windows service) static class Program { static void Main() { ServiceBase[] ServicesToRun; ServicesToRun = new ServiceBase[] { new AppServer() }; ServiceBase.Run(ServicesToRun); ContainerBootstrapper.BootstrapStructureMap(); } } And then I call an instance like this: var valueHolder = ObjectFactory.GetInstance<ValueHolder>(); But I get everytime an new instance not the one used before.

    Read the article

  • Class design question (Disposable and singleton behavior)

    - by user137348
    The Repository class has singleton behavior and the _db implements the disposable pattern. As excepted the _db object gets disposed after the first call and because of the singleton behavior any other call of _db will crash. [ServiceBehavior(InstanceContextMode=InstanceContextMode.Single)] public class Repository : IRepository { private readonly DataBase _db; public Repository(DataBase db) { _db = db; } public int GetCount() { using(_db) { return _db.Menus.Count(); } } public Item GetItem(int id) { using(_db) { return _db.Menus.FirstOrDefault(x=>x.Id == id); } } } My question is, is there any way to design this class to work properly without removing the singleton behavior? The Repositoryclass will be serving big amount of requests.

    Read the article

  • Resolve instance - Autofac

    - by user137348
    I'm trying to figure out how to resolve a instance somewhere in the code. At the application startup I registered a type static void Main() { var builder = new ContainerBuilder(); builder.RegisterType<Foo>().As<IFoo>(); } Now, how can I resolve an instance somewhere in the code ? In structure mam there is a static object ObjectFactory.GetInstance<IFoo>()

    Read the article

1