public MyClass(MyDependency dependency)
 {
     if (dependency == null)
     {
         throw new ArgumentNullException("dependency");
     }
 }
 public MyMessageHandler(Context testContext, MyDependency myDependency, MyAnotherDependency anotherDependency)
 {
     _testContext  = testContext;
     _myDependency = myDependency;
     _testContext.HandlerCreationAmount++;
     _anotherDependency = anotherDependency;
 }
 public MyConcreteWithDependency(MyDependency dependency)
 {
     if (dependency == null)
     {
         throw new System.ArgumentNullException("dependency");
     }
     Dependency = dependency;
 }
 public MyImpl(MyDependency dependency)
 {
     if (dependency == null)
     {
         throw new ArgumentNullException("dependency");
     }
     this.dependency = dependency;
 }
Example #5
0
        static void Main(string[] args)
        {
            var dependency = new MyDependency();

            dependency.Name = "Hello World";
            Console.WriteLine(dependency.Name);
            Console.ReadLine();
        }
 public WeatherForecastController(ILogger <WeatherForecastController> logger, MyDependency dependency, Operation TransientOperation,
                                  Operation ScopedOperation, Operation SingletonOperation)
 {
     _logger             = logger;
     _myDependency       = dependency;
     _TransientOperation = TransientOperation;
     _ScopedOperation    = ScopedOperation;
     _SingletonOperation = SingletonOperation;
 }
Example #7
0
        private void OnRegisterGlobalDependencies(object sender, RegisterGlobalDependenciesEventArgs e)
        {
            var container = e.ObjectContainer;

            if (!container.IsRegistered <IMyDependency>())
            {
                var dependency = new MyDependency();
                container.RegisterInstanceAs <IMyDependency>(dependency);
            }
        }
    public Startup(IHostingEnvironment env)
    {
        dependency = new MyDependency();
        var instance = new MyClass(dependency);
        var builder  = new ConfigurationBuilder()
                       .SetBasePath(instance.ContentRootPath)
                       .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
                       .AddEnvironmentVariables();

        Configuration = builder.Build();
    }
Example #9
0
        public IActionResult Login(LoginModel objLoginModel)
        {
            //string connection = _myConfiguration.DefaultConnection;
            string          vout            = UserInfoDC.ValidateUser(objLoginModel.UserName, objLoginModel.Password, objLoginModel.EmailStatus);
            MyDependency    myDependency    = new MyDependency();
            List <RoleInfo> objRoleInfoList = myDependency.GetUserInRoles(objLoginModel.UserName);

            if (vout == "Login Successfully")
            {
                string usercode     = UserInfoDC.GetUserId(objLoginModel.UserName);
                string suppliercode = UserInfoDC.GetSupplierCode(usercode);
                var    signingKey   = new SymmetricSecurityKey(Encoding.UTF8.GetBytes("this is my custom Secret key for authnetication"));
                var    claims       = new List <Claim>
                {
                    new Claim(JwtRegisteredClaimNames.Sub, objLoginModel.UserName),
                    new Claim(JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString())
                };
                foreach (var userRole in objRoleInfoList)
                {
                    claims.Add(new Claim(ClaimTypes.Role, userRole.RoleName));
                }


                var token = new JwtSecurityToken(
                    issuer: "Parama",
                    audience: "Shanta",
                    expires: DateTime.Now.AddMinutes(5),
                    claims: claims,
                    signingCredentials: new Microsoft.IdentityModel.Tokens.SigningCredentials(signingKey, SecurityAlgorithms.HmacSha256)
                    );
                return(Ok(new
                {
                    token = new JwtSecurityTokenHandler().WriteToken(token),
                    expiration = token.ValidTo,
                    message = vout,
                    UserID = usercode,
                    Email = objLoginModel.UserName,
                    SupplierCode = suppliercode
                }));
            }

            return(Unauthorized());
        }
Example #10
0
 public MyLink2(MyDependency dependency)
 {
     _dependency = dependency;
 }
Example #11
0
 public LoggingMiddleware(MyDependency dependency)
 {
 }
Example #12
0
 public MyClass(MyDependency dependency, MyOtherDependency otherDependency)
 {
     Dependency      = dependency;
     OtherDependency = otherDependency;
 }
 public MyInnerConfiguration(MyDependency dependency)
 {
     Dependency = dependency ?? throw new ArgumentNullException(nameof(dependency));
 }
 public MyForm(MyDependency dependent)
 {
Example #15
0
 public MyService2(MyDependency dep1, MyDependency dep2)
 {
     this.dep1 = dep1;
     this.dep2 = dep2;
 }
 public MyClass(MyDependency dependency, MyOtherDependency otherDependency)
 {
     Dependency = dependency;
     OtherDependency = otherDependency;
 }
 public MyAnotherDependency(MyDependency dependency)
 {
     CreationAmount++;
     _myDependency = dependency;
 }
 public MyClass(MyDependency dependency)
 {
     Dependency = dependency;
 }
Example #19
0
 public MyClass(MyDependency dependency)
 {
     Dependency = dependency;
 }
Example #20
0
 public MyTypeAttributeCommand(MyDependency dependency, ISomeOtherDependency otherDependency)
 {
     this.dependency      = dependency;
     this.otherDependency = otherDependency
 }
 public SomeClass()
 {
     MySubDependency mySubDependency = new MySubDependency();
     MyDependency    myDependency    = new MyDependency(mySubDependency);
     MyClass         myClass         = new MyClass(myDependency);
 }
 public MyClass(MyDependency myDependency)
 {
     _myDependency = myDependency;
 }
Example #23
0
 public MyService2(MyDependency dep1, MyDependency dep2)
 {
     this.dep1 = dep1;
     this.dep2 = dep2;
 }
 private static int StepOne(MyDependency dependency)
 {
     return(dependency.GetFirst3Primes().Sum());
 }
 public void SetMyDependency(MyDependency myDependency)
 {
     _myDependency = myDependency;
     Console.WriteLine("SetMyDependency called");
 }
 public LoggingMiddleware(AppFunc next, MyDependency dependency)
 {
     this.next = next;
 }