Search Results

Search found 4 results on 1 pages for 'keivan'.

Page 1/1 | 1 

  • Can a client dictate whether or not HttpContext is created?

    - by Keivan
    We are getting a lot of hits from Googlebot and BingBot and it appears that none of these requests have an HttpContext. I originally thought that every http request will get a context which obviously is not the case so I'm trying to understand how does an HttpContext gets constructed, is it part of the negotiation between client and server?

    Read the article

  • Improve this generic abstract class

    - by Keivan
    I have the following abstract class design, I was wondering if anyone can suggest any improvements in terms of stronger enforcement of our requirements or simplifying implementing of the ControllerBase. //Dependency Provider base public abstract class ControllerBase<TContract, TType> where TType : TContract, class { public static TContract Instance { get { return ComponentFactory.GetComponent<TContract, TType>(); } } public TContract GetComponent<TContract, TType>() where TType : TContract, class { component = (TType)Activator.CreateInstance(typeof(TType), true); RegisterComponentInstance<TContract>(component); } } //Contract public interface IController { void DoThing(); } //Actual Class Logic public class Controller: ControllerBase<IController,Controller> { public void DoThing(); //internal constructor internal Controller(){} } //Usage public static void Main() { Controller.Instance.DoThing(); } The following facts should always be true, TType should always implement TContract (Enforced using a generic constraint) TContract must be an interface (Can't find a way to enforce it) TType shouldn't have public constructor, just an internal one, is there any way to Enforce that using ControllerBase? TType must be an concrete class (Didn't include New() as a generic constrain since the constructors should be marked as Internal)

    Read the article

  • Disable VB.NET 10 Features in VS 2010

    - by Keivan
    is there a way to disable visual basic 10 language features in VS 2010. our Dev team has moved to Visual studio 2010, but we still have to keep backwards compatibility with Visual Studio 2008. is there a way to disable the new language features to avoid any issues.

    Read the article

  • Why is Serializable Attribute required for an object to be serialized

    - by Keivan
    Based on my understanding SerializableAttribute provides no compile time checks, as its all done at runtime, then why is it required for classes to be marked as serializable? Couldn't sterilizer just try to serialize an object and just fail? isn't it what it does right-now when something is marked, it tries and fails. wouldn't it be better if you had to mark things as unserializable rather than serializable? that way you wouldn't have the problem of libraries not marking things as serializable?

    Read the article

1