Search Results

Search found 13686 results on 548 pages for 'unity tweak tool'.

Page 25/548 | < Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >

  • WCF and Unity - Dependecy Injection

    - by Michael
    I'm trying to hock up WCF with dependecy injection. All the examples that I have found is based on the assumptions that you either uses a .svc (ServiceHostFactory) service or uses app.config to configure the container. Other examples is also based on that the container is passed around to the classes. I would like a solution where the container is not passed around (not tightly coupled to Unity). Where I don't uses a config file to configure the container and where I use self-hosted services. The problem is - as I see it - that the ServiceHost is taking the type of the service implementation as a parameter so what different does it do to use the InstanceProvider? The solution I have come up with at the moment is to register the ServiceHost (or a specialization) an register a Type with a name ( e.g. container.RegisterInstance<Type>("ServiceName", typeof(Service);). And then container.RegisterType<UnityServiceHost>(new InjectionConstructor(new ResolvedParameter<Type>("ServiceName"))); to register the ServiceHost. Any better solutions out there? I'm I perhaps way of in my assumptions. Best regards, Michael

    Read the article

  • Unity IoC and MVC modelbinding

    - by danielovich
    Is it ok to have a static field in my controller for my modelbinder to call ? Eg. public class AuctionItemsController : Controller { private IRepository<IAuctionItem> GenericAuctionItemRepository; private IAuctionItemRepository AuctionItemRepository; public AuctionItemsController(IRepository<IAuctionItem> genericAuctionItemRepository, IAuctionItemRepository auctionItemRepository) { GenericAuctionItemRepository = genericAuctionItemRepository; AuctionItemRepository = auctionItemRepository; StaticGenericAuctionItemRepository = genericAuctionItemRepository; } internal static IRepository<IAuctionItem> StaticGenericAuctionItemRepository; here is the modelbinder public class AuctionItemModelBinder : DefaultModelBinder { public override object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) { if (AuctionItemsController.StaticGenericAuctionItemRepository != null) { AuctionLogger.LogException(new Exception("controller is null")); } NameValueCollection form = controllerContext.HttpContext.Request.Form; var item = AuctionItemsController.StaticGenericAuctionItemRepository.GetSingle(Convert.ToInt32(controllerContext.RouteData.Values["id"])); item.Description = form["title"]; item.Price = int.Parse(form["price"]); item.Title = form["title"]; item.CreatedDate = DateTime.Now; item.AuctionId = 1; //TODO: Stop hardcoding this item.UserId = 1; return item; }} i am using Unity as IoC and I find it weird to register my modelbinder in the IoC container. Any other good design considerations I shold do ?

    Read the article

  • Unity: Replace registered type with another type at runtime

    - by gehho
    We have a scenario where the user can choose between different hardware at runtime. In the background we have several different hardware classes which all implement an IHardware interface. We would like to use Unity to register the currently selected hardware instance for this interface. However, when the user selects another hardware, this would require us to replace this registration at runtime. The following example might make this clearer: public interface IHardware { // some methods... } public class HardwareA : IHardware { // ... } public class HardwareB : IHardware { // ... } container.RegisterInstance<IHardware>(new HardwareA()); // user selects new hardware somewhere in the configuration... // the following is invalid code, but can it be achieved another way? container.ReplaceInstance<IHardware>(new HardwareB()); Can this behavior be achieved somehow? BTW: I am completely aware that instances which have already been resolved from the container will not be replaced with the new instances, of course. We would take care of that ourselves by forcing them to resolve the instance once again.

    Read the article

  • What corresponds to the Unity 'registration name' in the unity configuration section?

    - by unanswered
    When registering and resolving types in a Unity Container using code you can use 'Registration Names' to disambiguate your references that derive from an interface or base class hierarchy. The 'registration name' text would be provided as a parameter to the register and resolve methods: myContainer.RegisterType<IMyService, CustomerService>("Customers"); and MyServiceBase result = myContainer.Resolve<MyServiceBase>("Customers"); However when I register types in the configuration files I do not see where the 'registration name' can be assigned I register an Interface: <typeAlias alias="IEnlistmentNotification" type="System.Transactions.IEnlistmentNotification, System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> Then two types that I happen to know implement that interface: <typeAlias alias="PlaylistManager" type="Sample.Dailies.Grid.Workers.PlaylistManager, Sample.Dailies.Grid.Workers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" /> <typeAlias alias="FlexAleManager" type="Sample.Dailies.Grid.Workers.FlexAleManager, Sample.Dailies.Grid.Workers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" /> Then I provide mappings between the interface and the two types: <type type="IEnlistmentNotification" mapTo="FlexAleManager"><lifetime type="singleton"/></type> <type type="IEnlistmentNotification" mapTo="PlaylistManager"><lifetime type="singleton"/></type> That seems to correspond to this code: myContainer.RegisterType<IEnlistmentNotification, FlexAleManager>(); myContainer.RegisterType<IEnlistmentNotification, PlaylistManager>(); but clearly what I need is a disambiguating config entry that corresponds to this code: myContainer.RegisterType<IEnlistmentNotification, FlexAleManager>("Flex"); myContainer.RegisterType<IEnlistmentNotification, PlaylistManager>("Play"); Then when I get into my code I could do this: IEnlistmentNotification flex = myContainer.Resolve<IEnlistmentNotification>("Flex"); IEnlistmentNotification play = myContainer.Resolve<IEnlistmentNotification>("Play"); See what I mean? Thanks, Kimball

    Read the article

  • MVC 3 beta + Dependency Resolver + Unity = got problem

    - by drsim
    Hi everyone. I'm tried to use Dependency Resolver with Unity, and got some problem when my Controller creating. Here example of controller: public class AccountController : Controller { private readonly ICourseService _courseService; public AccountController(ICourseService courseService) { _courseService = courseService; } } But, when Controller try to create - i got an exception "No parameterless constructor defined for this object." I even try to add default constructor for this controller, but courseService didn't create. Also try to add property with [Dependency] attribute - nothing happened. Here is Dependency Resolver class: public class UnityDependencyResolver : IDependencyResolver { private readonly IUnityContainer _container; public UnityDependencyResolver(IUnityContainer container) { _container = container; } public object GetService(Type serviceType) { return _container.IsRegistered(serviceType) ? _container.Resolve(serviceType) : null; } public IEnumerable<object> GetServices(Type serviceType) { return _container.IsRegistered(serviceType) ? _container.ResolveAll(serviceType) : new List<object>(); } } and Global.asax.cs: protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RegisterGlobalFilters(GlobalFilters.Filters); RegisterRoutes(RouteTable.Routes); var container = new UnityContainer(); container.RegisterType<ICourseService, CourseService>(); DependencyResolver.SetResolver(new UnityDependencyResolver(container)); } Can anyone help me ?

    Read the article

  • Hudson.. another Continuous Integration tool

    - by Narendra Tiwari
    In my previous posts I discussed about Cruisecontrol.net and its legacy support to .Net development. Hudson  is yet another continuous integration tool. Hudson is also free like CCNet and built in java. - CCNet has its legacy support to .Net applications where as Hudson can be easily configured on both the environments (.Net and Java). - One of the major differences in CCNet and Hudson is the richer GUI of Hudson provide user interactive screens for project configuration where as in CCNet we have to play with a few xml configuration files. Both the tools are capable of providing basic features of continuous integration e.g.:- - Source Control configuration - Code Compilation/Build - Ad hoc plugin tools to be configured along with compilation Support for adhoc tools seems to be bigger with CCNet e.g. There are almost every source control plugin available with CCNet where as Hudson has support for limited source control servers. Basically there is an interseting point to see is that there are 2 major partsof whole CI system one performed by build tool and rest. Build tool takes care of all adhoc plugin tools  so no matter if CI tool does not have plugin for that tool if thet tools provides command line support that can be configured in build tool and that build tool is then configured with CI tool inturn. For example if I have a build script configured in MSBuild and CCNet can be easily switched to Hudson. Here we need not to change anything in build script we just need to configure MSBuild on Hudson and pass the path of script file and thats it... all is same. Hudson Resources:- - https://hudson.dev.java.net/ - http://wiki.hudson-ci.org/display/HUDSON/Meet+Hudson - http://wiki.hudson-ci.org/display/HUDSON/Plugins - http://callport.blogspot.com/2009/02/hudson-for-net-projects.html Java support on CCNet http://confluence.public.thoughtworks.org/display/CC/Getting+Started+With+CruiseControl?focusedCommentId=19988484#comment-19988484 Please share your thoughts...

    Read the article

  • VS 11 Beta merge tool is awesome, except for resovling conflicts

    - by deadlydog
    If you've downloaded the new VS 11 Beta and done any merging, then you've probably seen the new diff and merge tools built into VS 11.  They are awesome, and by far a vast improvement over the ones included in VS 2010.  There is one problem with the merge tool though, and in my opinion it is huge.Basically the problem with the new VS 11 Beta merge tool is that when you are resolving conflicts after performing a merge, you cannot tell what changes were made in each file where the code is conflicting.  Was the conflicting code added, deleted, or modified in the source and target branches?  I don't know (without explicitly opening up the history of both the source and target files), and the merge tool doesn't tell me.  In my opinion this is a huge fail on the part of the designers/developers of the merge tool, as it actually forces me to either spend an extra minute for every conflict to view the source and target file history, or to go back to use the merge tool in VS 2010 to properly assess which changes I should take.I submitted this as a bug to Microsoft, but they say that this is intentional by design. WHAT?! So they purposely crippled their tool in order to make it pretty and keep the look consistent with the new diff tool?  That's like purposely putting a little hole in the bottom of your cup for design reasons to make it look cool.  Sure, the cup looks cool, but I'm not going to use it if it leaks all over the place and doesn't do the job that it is intended for. Bah! but I digress.Because this bug is apparently a feature, they asked me to open up a "feature request" to have the problem fixed. Please go vote up both my bug submission and the feature request so that this tool will actually be useful by the time the final VS 11 product is released.

    Read the article

  • Ubuntu 3D does not work on Dell system with a AMD Radeon HD 6470M

    - by VeeKay
    I am running 64 bit Ubuntu on Dell with 1GB graphic card. I login with "Ubuntu" hoping to see Unity 3d but it doesn't. Unity 2D runs instead. when I type in echo "$DESKTOP_SESSION" it confirms the Unity-2D. I've checked the System info that shows like : The graphics row shows itself as empty. SO I've presumed that the graphic drivers aren't detected and hence I went to Unity- Additional Drivers and installed the fglrx driver that the UI has suggested. Even after installing so, the graphics part in System info details shows nothing and still Unity 2D runs in spite of all the effort. Please help! How can I get my Unity 3D back? Hardware Info Video Card : AMD Radeon™ HD 6470M - 1GB (For ICC) RAM : 6GB (1 X 2GB + 1 X 4GB) 2 DIMM DDR3 1333Mhz OS : 64 bit Ubuntu 11.10 Edit : Output for /usr/lib/nux/unity_support_test -p X Error of failed request: BadRequest (invalid request code or no such operation) Major opcode of failed request: 155 (GLX) Minor opcode of failed request: 19 (X_GLXQueryServerString) Serial number of failed request: 21 Current serial number in output stream: 21

    Read the article

  • Is it possible to mix MEF and Unity within a MEF-based plugin?

    - by Dave
    I'm finally diving into Unity head first, and have run into my first real problem. I've been gradually changing some things in my app from being MEF-resolved to Unity-resolved. Everything went fine on the application side, but then I realized that my plugins were not being loaded. I started to look into this issue, and I believe it's a case where MEF and Unity don't mix. Plugins are loaded by MEF, but each plugin needs to get access to the shared libraries in my application, like app preferences, logging, etc. Initially, my plugin constructor had the ImportingConstructor attribute. I then replaced it with InjectionConstructor so that Unity could resolve its shared library dependencies. But because I did that, MEF no longer loaded it! Then I used both attributes, which compiled, but then I got a composition error (MEF). I figured that this was because the constructor takes a parameter that was once resolved by a MEF Import, so I removed all parameters. As expected, now MEF was able to load my plugin, but because the constructor needs to call into the interface that was once passed in, construction fails. So now I'm at a point where I can get MEF to start to load my plugin, but can't do anything with it because the plugin relies on shared libraries that are registered with Unity. For those of you that have successfully mixed MEF and Unity, how do you go about resolving the references to the shared libraries with Unity?

    Read the article

  • checking player prefs from unity in xcode

    - by user313100
    I made a simple scene that has some GUI buttons in Unity. When you press a button it will set a player preference to 1. I have a button for facebook, twitter and a store. In XCode, when the value hits 1, it switches to a new window with facebook, twitter or the store. My problem is that when I try and retrieve the player preferences in XCode, they always come up as null. To compound my confusion, my code seems to respond to the switch to 1 and it switches to the new window when the value hits 1. Any ideas why it manages to switch to the other window and why I am getting null values? - (void) applicationDidFinishLaunching:(UIApplication*)application { printf_console("-> applicationDidFinishLaunching()\n"); NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; [userDefaults setInteger:0 forKey:@"Store"]; [userDefaults setInteger:0 forKey:@"Facebook"]; [userDefaults setInteger:0 forKey:@"Twitter"]; _storeWindow = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; _facebookWindow = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; _twitterWindow = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; viewControllerSK = [[SKViewController alloc]initWithNibName:@"SKViewController" bundle:nil]; viewControllerFacebook = [[xutils_exampleViewController alloc]initWithNibName:@"FacebookViewController" bundle:nil]; viewControllerTwitter = [[xutils_exampleViewController2 alloc]initWithNibName:@"TwitterViewController" bundle:nil]; [_storeWindow addSubview:viewControllerSK.view]; [_facebookWindow addSubview:viewControllerFacebook.view]; [_twitterWindow addSubview:viewControllerTwitter.view]; [SKStoreManager sharedManager]; [self startUnity:application]; } - (void) applicationDidBecomeActive:(UIApplication*)application { printf_console("-> applicationDidBecomeActive()\n"); if (gDidResignActive == true) { UnitySetAudioSessionActive(true); UnityPause(false); } gDidResignActive = false; [self newTimer]; } - (void) applicationWillResignActive:(UIApplication*)application { printf_console("-> applicationDidResignActive()\n"); UnitySetAudioSessionActive(false); UnityPause(true); gDidResignActive = true; } - (void) applicationDidReceiveMemoryWarning:(UIApplication*)application { printf_console("WARNING -> applicationDidReceiveMemoryWarning()\n"); } - (void) applicationWillTerminate:(UIApplication*)application { printf_console("-> applicationWillTerminate()\n"); UnityCleanup(); } -(void)newTimer { NSTimer *theTimer = [self getTimer]; [theTimer retain]; [[NSRunLoop currentRunLoop] addTimer: theTimer forMode: NSDefaultRunLoopMode]; } -(NSTimer *)getTimer { NSTimer *theTimer; theTimer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector: @selector(onLoop) userInfo:nil repeats:YES]; return [theTimer autorelease]; } -(void)onLoop { NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; //NSLog(@"FB: %@", [userDefaults integerForKey:@"Facebook"]); if ([userDefaults integerForKey:@"Store"] != 1 && [userDefaults integerForKey:@"Facebook"] != 1 && [userDefaults integerForKey:@"Twitter"] != 1) { UnityPause(FALSE); _window.hidden = NO; _storeWindow.hidden = YES; _facebookWindow.hidden = YES; _twitterWindow.hidden = YES; [_window makeKeyWindow]; } if ([userDefaults integerForKey:@"Store"] == 1) { UnityPause(TRUE); _storeWindow.hidden = NO; _window.hidden = YES; [_storeWindow makeKeyWindow]; } if ([userDefaults integerForKey:@"Facebook"] == 1) { UnityPause(TRUE); _facebookWindow.hidden = NO; _window.hidden = YES; [_facebookWindow makeKeyWindow]; } if ([userDefaults integerForKey:@"Twitter"] == 1) { UnityPause(TRUE); _twitterWindow.hidden = NO; _window.hidden = YES; [_twitterWindow makeKeyWindow]; } } -(void) dealloc { DestroySurface(&_surface); [_context release]; _context = nil; [_window release]; [_storeWindow release]; [_facebookWindow release]; [_twitterWindow release]; [viewControllerSK release]; [viewControllerFacebook release]; [viewControllerTwitter release]; [super dealloc]; }

    Read the article

  • command line tool text output

    - by Martin
    I have a small command line tool and after running it, I'd like to display the text output in a way that's easy for someone to copy/paste and save it or email it to someone else. Copy/pasting from a command prompt is not done in the standard way, so I don't want people to have to copy/paste from there. Saving the file to disk is possible, but the folder where the tool is located may not have access rights so the user would have to configure the output file location (this may be too tricky for some users). I was thinking of launching notepad with some text in it, generated from the command line tool. Is this possible? Any other suggestions?

    Read the article

  • Why does the terminal in unity 2d (Ubuntu 11.10) always stay in the foreground?

    - by user32509
    I have just updated to Ubuntu 11.10 and I am using unity 2d. My terminal applications (gnome-terminal or konsole) just won't go into background. When I move another application in front of them, they are still rendered, but the clicks are going through them. This behavior only appears when the terminal windows interact with another applications. I can move one terminal over another without a problem, but even the menu list of a terminal application can not be shown, since it is - for some unknown reason - "behind" the terminal. Any ideas what might be the cause of this problem? I do not have this problem with my other machines. The only difference is, that I am using unity 2d here and ("normal") unity at home.

    Read the article

  • A testing feedback/report tool?

    - by Mert
    I'm thinking of developing a pluggable test and assessment module. This tool will be used especially for desktop application projects to report and log errors, bugs, missing features and suggestions from testers. The tool will be plugged to the application by putting a small icon to the application itself. When pressed the tool will be visible where user can create entries about the application. Is there already a tool like that? I am not speaking about UI testing btw. For example, this tool might have a form consisting of Page name Environment information Entry type (can be bug, feature request, suggestion) Message User Info (name, contact etc) Date I think such a tool can greatly help testers prepare reports. Developers can understand the issue better and track all the reports.

    Read the article

  • Xpath Injection detection Tool

    - by preeti
    Hi, I am working on xpath Injection attack, so looking forward to build a tool to detect xpath Injection Tool in a website.Is web crawling and scanning be used for this? What can be the Logic to detect it? Are there any open source tools to detect it, so that i can develop it in Java by looking at logic used in that code. Thank You.

    Read the article

  • Http Request Monitoring Tool

    - by noli
    Hi! I would like to know if anybody can recommend an Http Request Monitoring Tool aside from HttpWatch and Firebug. What I want from the tool is for it to show me the time it took the request to arrive at the web server. HttpWatch can show me the network latency and the server times in one result but i want them separately. My goal is to isolate the network latency from the server processing times. Thanks.

    Read the article

  • Code review tool for CM synergy

    - by Ravisha
    I am looking for a code review tool which can be configured with CM synergy .We are having java project with Eclipse 3.4 as IDE.And need a simple code review tool on windows XP. http://www.windriver.com/cgi-bin/partnerships/directory/viewProd.cgi?id=1451

    Read the article

  • OpenGl ES Eraser Tool

    - by Erika
    Hi Everyone, I am trying to implement an OpenGL eraser tool. I am struggling with this. I was thinking of painting somehow over the previous changes to "clear" out the changes. I can't use the background color because it is not a pattern, not one solid color. Can you point me to the right direction on how to implement an eraser tool ? This is for the iPhone OS but that shouldn't matter. Thanks

    Read the article

  • ASP .NET Code analysis tool to check cross site scripting

    - by Prashant
    I am aware of a tool which MS has provided which tells you about coss site scripting attack etc. The tool is http://www.microsoft.com/downloads/details.aspx?FamilyId=0178e2ef-9da8-445e-9348-c93f24cc9f9d&displaylang=en But are there tools which you have used for ASP .NET applications which do similar to this and which one is widely used in ASP .Net applications ?

    Read the article

  • Interception with Unity in Prism v2 for WPF (not working for me)

    - by Bobby Chopra
    I cannot get interception to work with Prism v2 (Oct 2009). I am trying to intercept the Setter for any Public Properties and then fire the PropertyChanged event if the property has changed. I can see that the code gets executed (by stepping through with the debugger or adding a debug point). However, the WPF Window controls that are bound to these properties do not get updated. If I subscribe to these events and print to the console, I can print out the property change notifications. So, if the View has a textbox, which updates the property on the ViewModel, then the property in the ViewModel gets updated. However, if a button on the view (implemented as a DelegateCommand) causes the property to get updated, then the textbox (TwoWay Binding Mode) that is bound to that Property is not updated even though the event is triggered and the console has printed out the information about which property was updated. Has anyone encountered this issue? Here is the sample WPF Application that I have written. Wordpress doesn't allow uploads of zip files, so I renamed it to have a pdf extension (rename the file to have a zip extension). Please let me know what I am doing wrong. Thanks in advance.

    Read the article

  • Dealing with Unity's Global Menu and Overlay Scrollbars under Free Pascal/Lazarus

    - by Gustavo Carreno
    I've had some problems under the IDE that were fixed with unsettings and disabling Global menu and the Overlay Scrollbars. I've reported the problem in Lazarus' Mantis: #0021465, #0021467. There is also this bug report talking a bit more about it: #0019266 Their solution was to use unsettings to turn off Global Menu and Overlay Scrollbars. I've had a quick search about the problem and there's an open bug report at Launchpad: overlay scrolling is broken in lazarus. So, is the problem related to "lib overlay scrollbar"? If it is, is there a solution via code, to avoid turning off both the Global Menu and Overlay Scrollbars? If NOT, is there anyone taking notice and fixing the issue? Many thanks, Gus

    Read the article

  • Register and Resolve Generic Interfaces Unity

    - by user1643791
    I am trying to register some generic interfaces and resolve them . I have the registering function private static void RegisterFolderAssemblies(Type t,string folder) { var scanner = new FolderGenericInterfaceScanner(); var scanned = scanner.Scan(t,folder); // gets the implementations from a specific folder scanned.ForEach(concrete => { if (concrete.BaseType != null || concrete.IsGenericType) { myContainer.RegisterType(t, Type.GetType(concrete.AssemblyQualifiedName), concrete.AssemblyQualifiedName); } }); } which is called by the bootstrapper with RegisterFolderAssemblies(typeof(IConfigurationVerification<>),Environment.CurrentDirectory); The registration seem to go through ok but when I try to Resolve them with Type generic = typeof(IConfigurationVerification<>); Type specific = generic.MakeGenericType(input.Arguments[0].GetType()); var verifications = BootStrap.ResolveAll(specific); The input.Arguments[0] is an object of the type the generic is implemented in I also tried using typeof(IConfigurationVerification<) instead and get the same error . When ResolveAll is public static List<object> ResolveAll(Type t) { return myContainer.ResolveAll(t).ToList(); } I get a ResolutionFailedException with them message "The current type, Infrastructure.Interfaces.IConfigurationVerification`1[Infrastructure.Configuration.IMLogPlayerConfiguration+LoadDefinitions], is an interface and cannot be constructed. Are you missing a type mapping?" Any help will be great. Thanks in advance

    Read the article

  • Comparing Flash, HTML, Silverlight, X3D and Unity 3d

    - by Amira Elsayed
    I have to prepare a comparison between the following technologies to present it to my Project Manager, but I fell that I'm lost, so if any one can help I will be thankful I want to compare between them in the following areas: the support of online video streaming the budget of using each one Learning Time will be needed to learn the technology Which one is the standard and will target a lot of users The support if I found any problem Bugs and security issues connection to DB, SOA and web services supporting of multi player

    Read the article

  • Unity Framework constructor parameters in MVC

    - by ubersteve
    I have an ASP.NET MVC3 site that I want to be able to use different types of email service, depending on how busy the site is. Consider the following: public interface IEmailService { void SendEmail(MailMessage mailMessage); } public class LocalEmailService : IEmailService { public LocalEmailService() { // no setup required } public void SendEmail(MailMessage mailMessage) { // send email via local smtp server, write it to a text file, whatever } } public class BetterEmailService : IEmailService { public BetterEmailService (string smtpServer, string portNumber, string username, string password) { // initialize the object with the parameters } public void SendEmail(MailMessage mailMessage) { //actually send the email } } Whilst the site is in development, all of my controllers will send emails via the LocalEmailService; when the site is in production, they will use the BetterEmailService. My question is twofold: 1) How exactly do I pass the BetterEmailService constructor parameters? Is it something like this (from ~/Bootstrapper.cs): private static IUnityContainer BuildUnityContainer() { var container = new UnityContainer(); container.RegisterType<IEmailService, BetterEmailService>("server name", "port", "username", "password"); return container; } 2) Is there a better way of doing that - i.e. putting those keys in the web.config or another configuration file so that the site would not need to be recompiled to switch which email service it was using? Many thanks!

    Read the article

< Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >