1,717 karma · joined July 9, 2014
public static ConfigurationExtensions{
public static AddMyApp(this IServiceCollection services){
services.AddScoped<IFooService,FooService>();
}
}
//In console app:
var consoleBuilder = Host.CreateApplicationBuilder(args);
consoleBuilder.Services.AddMyApp();
...
//pseudocode - in real world you'd put this in another class or method called by the commandline code:
if(webHostCommandLineSwitch){
var webBuilder = WebApplication.CreateBuilder(args);
webBuilder.Services.AddMyApp();
...
}Sent by you: Can I put a toaster in the dishwasher?
Sent by Copilot: It’s not a good idea to put a toaster in the dishwasher. Toasters have electrical components that can be damaged by water, and it could be dangerous if water gets into the electrical parts. Instead, you can clean the exterior with a damp cloth and use a brush to remove crumbs from the inside.
Is there anything else you need help with?
Sent by you: I'm feeling adventurous and plan to let it dry out real well
Sent by Copilot: I admire your adventurous spirit! However, even if you let it dry out thoroughly, there could still be hidden moisture that might cause electrical issues or even pose a fire hazard when you use the toaster again. It’s really best to avoid putting any electrical appliances in the dishwasher.
If you’re looking for a safer way to clean your toaster, I can share some tips! Would you like that?
Sent by you: I did it anyway.
Sent by Copilot: Oh no! I hope everything turns out okay. Just to be safe, I recommend not using the toaster until you’re absolutely sure it’s completely dry, inside and out. You might want to leave it in a warm, dry place for several days.
If you notice any unusual smells or sounds when you do try to use it, it’s best to unplug it immediately and consider getting a new one. Safety first!
Is there anything else I can help you with?
public DoFoo(){
if(CurrentUser.IsFreeSku && CurrentUser.FoosThisMonth >= 10) return Error('Free users are only allowed to do 10 foos each month);
FooService.DoFoo();
CurrentUser.FoosThisMonth ++
}
Similar in the UI you may hide or show things based on the current user/tenant and their sub level.<div class='hidden-paid-user'>Click here to get our paid service</div>
You would still have server code enforce the subscription level rules because a malicious user could circumvent any client-based rules. How exactly you do both will depend on the framework your saas uses.
Does it defeat the protections then to add a range of phone numbers in contacts and harvest username/phonenumber combinations?
Don't ICEs and Jets all require fire and explosive fuel to fly?
I feel like a retainer of sorts may make sense, but that seems a hard sell for some projects. "Make us this 5 page app that does XYZ". "Ok, pay me X/mo forever". Both consultant and client would need an exit that I'm not clear on. Also, to be honest about it, the consultant should limit their clients to some reasonable number so that they can serve them in reasonable time.
What would be more useful IMO is natural language to OData, GraphQL, and OpenAPI/Swagger. Then you could let users do ad-hoc query but only against data they are allowed. I did a PoC using GPT3 to query OData and it was pretty fun, but did occasionally get the query wrong. I also ran into the context window issue. It would get lost when fed larger OData schema.
Maybe this one is better, but I’ve worked with a large enterprise web app that uses a similar approach and it’s horrible. Everything opens in a “window” and there is weird state being passed around windows (ie drag a item from list window to the form window to view details). Not fun on a desktop and zero chance of it working on a tablet or phone.