Question: I am trying to write up a Microsoft Access query that will return all of the data in a table where the assigned "Due By" date is within a day. 

Meaning, when I come into the office in the AM, I should be able to run this query to see what was due yesterday and what is due today. Here is an example of the data:   

```
 | ID | JobName                 | DueBy     |
 |----|-------------------------|-----------|
 | 1  | Sergio Pizza            | 5/5/2018  |
 | 2  | Hopkins Hospital        | 9/1/2018  |
 | 3  | Perry Hall High School  | 9/25/2018 |
 | 4  | Parkville High School   | 9/24/2018 |
 | 5  | Jim's House             | 9/24/2018 |

```

My current query is:

```
SELECT tblBid.*
FROM tblBid
WHERE (((tblBid.Due_By)>=(Now()-2)));

```

Which works in returning the **correct** dataset:   

```
 | ID | JobName                 | DueBy     |
 |----|-------------------------|-----------|
 | 3  | Perry Hall High School  | 9/25/2018 |
 | 4  | Parkville High School   | 9/24/2018 |
 | 5  | Jim's House             | 9/24/2018 |

```

However, why do I need to write NOW()-2 and not NOW()-1? Why do I have to go back two days? When I write NOW()-1 I only get ID 3 for Perry Hall High School

Thank you!

Answer: 
As mentioned in the comments, it is not clear what you trying to achieve, but in order to do DI in .Net Core you have to create an interface IMyClass, then let your class implement that interface,

```
public interface IMyClass {
   void SampleMethod();
}

public class MyClass : IMyClass
{
    ILoginTokenKeyApi _loginTokenKeyApi;

    public MyClass(ILoginTokenKeyApi loginTokenKeyApi)
    {
        _loginTokenKeyApi = loginTokenKeyApi;
    }

    public void SampleMethod()
    {
        // method logic goes here...
        var xx = _loginTokenKeyApi.WhatEver;
    }
}

```

then register ILoginTokenProvider and IMyClass in startup.cs

```
services.AddTransient<ILoginTokenProvider, LoginTokenProvider>();
services.AddTransient<IMyClass, MyClass>();

```

finally inject IMyClass where you need it:

```
public class IndexModel : PageModel {

    private readonly IMyClass _myClass;

    public IndexModel(IMyClass myClass)
    {
        _myClass = myClass;
    }

    public void OnGet()
    {
       _myClass.SampleMethod();
    }
}

```

btw, it is also possible to register and inject MyClass without implementing IMyClass interface, but I prefer to follow basic programming principals :)
There are two types of Dependency Injections.

1. Constructor Injection - which you dont want
2. Property Injection - In this - you expose Public Get/Set property of the Object you want to be injected. And then in your DI config file (like spring.net) you can assign values.

Another way you can do DepInjection is that in the param less constructor - you can get the Object by a Key/Name. Like in Spring.Net we would do:

```
var UtilityObject = Spring.ContextRegistry.GetContext().GetObject("MyUtilObject") as TheUtilityClass;

```