|
Member 12045692 wrote: Provider = new SimpleAuthorizationServerProvider(), You haven't supplied an argument here. You're trying to create an instance without supplying the correct instantiation signature.
This space for rent
|
|
|
|
|
Yes, I know. But what kind of argument should I provide here?
|
|
|
|
|
You will need to pass an object of a class that implement IAuthService interface.
"It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[ ^]
|
|
|
|
|
I can't just pass an object that implements IAuthService, because IAuthService implements IAuthRepository. So either to create an object that implements IAuthService, I must first create an object that implements IAuthRepository, and pass that object as an parameter into IAuthService.
Either to have access to IAuthRepository from my startup.cs, my Ui-layer must have an reference to my third layer(DataAccess-layer), and that's not the way to do It.
It seems that I have to sovle this in an another way..
|
|
|
|
|
You simply don't have a choice here. You either pass an object that implements IAuthService either directly or through inheriting from another class that implements it, or you don't use this code. End of story.
|
|
|
|
|
Why do we seem to be getting so many queries about complex subjects from people that clearly don't have a clue about the basics recently?
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
And how can that help me?
|
|
|
|
|
Because if you knew the basics, you would know what the error message meant, rather than have to have Pete explain it...
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I knew what It meant. Read my reply about the difficulties to pass an object that implements IAuthService.
|
|
|
|
|
It sounds like you're trying to use Dependency Injection with your provider instances. It's not simple, but there are a few suggestions in this StackOverflow thread[^].
For example:
public class Startup
{
public void Configuration(IAppBuilder app)
{
var container = SimpleInjectorConfig.Register();
GlobalConfiguration.Configure(WebApiConfig.Register);
Func<IAuthService> authServiceFactory = () => container.GetInstance<IAuthService>();
var OAuthServerOptions = new OAuthAuthorizationServerOptions
{
AllowInsecureHttp = true,
TokenEndpointPath = new PathString("/token"),
AccessTokenExpireTimeSpan = TimeSpan.FromDays(1),
Provider = new SimpleAuthorizationServerProvider(authServiceFactory),
RefreshTokenProvider = new SimpleRefreshTokenProvider(authServiceFactory),
};
app.UseOAuthAuthorizationServer(OAuthServerOptions);
app.UseOAuthBearerAuthentication(new OAuthBearerAuthenticationOptions());
}
}
Your provider classes will need to be changed to take a Func<IAuthService> delegate instead of an IAuthService instance. Whenever they need an IAuthService instance, they call the factory delegate.
public class SimpleAuthorizationServerProvider : OAuthAuthorizationServerProvider
{
private readonly Func<IAuthService> _authServiceFactory;
public SimpleAuthorizationServerProvider(Func<IAuthService> authServiceFactory)
{
_authServiceFactory = authServiceFactory;
}
...
public override Task GrantAuthorizationCode(OAuthGrantAuthorizationCodeContext context)
{
IAuthService authService = _authServiceFactory();
...
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi mates
i hope its been awesome
i got a question...?
i have to do some project in C#
who can help me?
that is ...
a management clinic which is include
1) adult or 2) child
and it has a person as a GP
if GP diagnosis Cold , then give a prescription with price
else referral to Specialist (with random function)
if specialist diagnosis the patient need to surgery , print coast
else print all prescription with price
I'll appreciate in advance to help me guys
|
|
|
|
|
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.
Try it yourself, you may find it is not as difficult as you think!
If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Questions like this depend entirely on your definition of "help".
If you're asking for a "partner" to write your code for you, you're not going to get that help.
If you've written a bunch of code and you're stuck with a particular problem, that we can help with, provided you ask a detailed question describing the problem.
|
|
|
|
|
|
What is your basis for merge? Also, how is the visual representation different from underlying data source?
The control does not directly give options to merge. You will need to override the Paint event for the control and then show/hide borders.
"It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[ ^]
|
|
|
|
|
I purchased a Bosch BNO055 multifunction sensor USB stick. I believe I need to add it to the appxmanifest file manually. I don't know where/how to find the correct DeviceID and Function Type values to enter into the xml elements. The driver that I downloaded does not seem to offer any hints and I am not fluent in C++.
If anyone has experience with this type of unit I would like to benefit from your experience.
|
|
|
|
|
1. plug the device into the PC.
2. Open Device Manager
3. Right-click the device and choose properties. I think you can find the Device ID there.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Yes, thank you for the help.
|
|
|
|
|
I'm currently using C++ Builder and I'm only doing console programming at the moment. But eventually I will move forward into making some Windows programs. One program I'd like to write is a test. I'd like to make a psychology test. This will have about 10 questions. Either just true or false or maybe I'll decide they will be multiple choice.
My question is which language and IDE do you think would be easier to get this done? Visual Studio using C# or Embarcadero C++ Builder?
I can't seem to come to a conclusion myself so here I ask.
|
|
|
|
|
That isn't up to us: only you can make that decision.
Why? Because we have no idea how competent you are in either of those languages. Me? I'd probably be faster in C# because I use it more these days. Some other members will reverse that, because they use C++ more often so are more comfortable using that.
Pick the language you know best, and you'll probably have made the right decision.
Sent from my Amstrad PC 1640
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
In addition to OriginalGriff's comments, Visual Studio 2017 Community Edition (which is free) is an ideal IDE. Furthermore is supports Windows application building in C, C++, C#, VB.NET etc., and Web development in ASP.NET. So choose the language that you are most experienced with and use Visual Studio as the IDE.
|
|
|
|
|
Member 12974235 wrote: This will have about 10 questions. Either just true or false or maybe I'll decide they will be multiple choice. Most languages know the concept of a "loop". So, the language to use is not determined by the amount of questions.
I'd say Visual Basic is the way to go. Lots of examples out there, including psychology tests.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Eddy Vluggen wrote: I'd say Visual Basic is the way to go With a C++ background!!! I would have thought c# would be the best platform to learn and there are many more examples on the interweb that VB.net (one of the reasons I moved from VB.Net).
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: With a C++ background!!! Then he'll be able to grasp VB quickly
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|